52890

java.lang.ClassNotFoundException: javax.el.StaticFieldELResolver

Question:

I am attempting to run a project with a servlet that was working a few weeks ago (no modifications have been made since). However, when I run it I now get the following error:

java.lang.ClassNotFoundException: javax.el.StaticFieldELResolver

I've seen similar questions out there such as <a href="https://stackoverflow.com/questions/6360121/java-lang-noclassdeffounderror-javax-el-elresolver-when-running-simplehellobyen" rel="nofollow">this one</a>, but their solutions did not work for me. I've tried the following unsuccessfully:

<ul><li>Removing all other library references other than JDK 1.7 and Apache Tomcat 7.0.41.0</li> <li>Updating the web.xml file from 2.5 to 3.0: <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"></li> <li>Updating the sun-web.xml file from 2.5 to 3.0: <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd"></li> <li>Verifying that the Tomcat library includes el-api.jar and jsp-api.jar </li> <li>Setting the CATALINA_HOME environment variable to point to the Tomcat directory</li> </ul>

The IDE being used is NetBeans 7.4 running Apache Tomcat 7.0.41.0 with Java 7. Any help is greatly appreciated.

<strong>UPDATE:</strong>

Oddly, if I choose to run it with GlassFish instead of Tomcat it runs without error. So there must be some relationship to the Tomcat server.

Answer1:

The class javax.el.StaticFieldELResolver is part of the <a href="http://docs.oracle.com/javaee/7/api/javax/el/StaticFieldELResolver.html" rel="nofollow">EL 3.0 API.</a> AFAIK it is not available in Tomcat 7 versions. <a href="http://tomcat.apache.org/download-80.cgi" rel="nofollow">It is available in Tomcat 8</a>, but that is not in General Availability yet, so use it as your own risks.

You must have changed something.

Answer2:

Solution 1: Inner of the apache-tomcat-x.x.xx\lib folder el-api.jar file set classpath environment variable.

Solution 2: copy apache-tomcat-x.x.xx\lib\el-api.jar file in to jreX.X.X_XXX\lib\ext\ folder.

because it is used to preload tomcat server start

Recommend

  • JBoss - How can to exclude javax.validation in jboss-deployment-structure?
  • Deploy war problem
  • Changing app.servlet.version does not affect web.xml
  • Error: Wrapper cannot find servlet class VendorRegistration or a class it depends on
  • python function to set accuracy of float
  • SessionInformation expiration doesn't lead to user log out from system
  • Reading contents of a managed bean with reflection in a JSF application
  • Is there a better method than to reuse a complicated table in DocBook?
  • Easy Way to Get Averages Based on Names in List
  • maven-dependency-plugin ignores outputDirectory configuration
  • object play not found in scala application
  • Sending Content-Type application/x-www-form-urlencoded WSO2 ESB
  • JSF2.0 + Primefaces 3.0.1 + jquery 1.6.4 + p:commandLink + IE8 throws Unexpected call to method or p
  • how to ignore xml namespaces?
  • Should a web service response include empty values?
  • rewrite uppercase url to lowercase url htaccess
  • Splash Screen will not display
  • CERN ROOT exporting data to plain text
  • JBoss External Properties Files in Classpath
  • Android - Material Design - NavigationView - How to put vertical scroll?
  • Jetty 9 HashLoginService
  • Play WS (2.2.1): post/put large request
  • Cancel a live stream “fast motion” catch-up in Flash
  • does jqgrid support a multiple checkbox list for editing
  • Pass value from viewmodel to script in zk
  • Optimizing database types to compact database (SQLite)
  • Java applet as stand-alone Windows application?
  • Cross-Platform Protobuf Serialization
  • Deserializing XML into class C#
  • Do I've to free mysql result after storing it?
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Is there a mandatory requirement to switch app.yaml?
  • bootstrap to use multiple ng-app
  • How to get icons for entities from eclipse?
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • coudnt use logback because of log4j
  • Turn off referential integrity in Derby? is it possible?
  • JaxB to read class hierarchy
  • How to Embed XSL into XML