java.lang.NoClassDefFoundError:javax / el / ELException

我正在开发Web应用程序,并且在查看多个帖子后已经遇到了一段时间,但仍然无法解决此问题.我正在使用提供el-api的tomcat 7.0.23,我认为这是缺少的jar.我根本没有在WEB-INF / lib文件夹中包含任何jar文件,由于maven,我正在通过pom.xml添加所有依赖项.我已经尝试过所有可能的快速修复方法,包括Maven清理/安装服务器清理(多次),项目清理,将tomcat添加到目标运行时.在我的构建路径中是tomcat,jdk1.6和maven)

我正在使用的pom.xml和web.xml文件与我的其他团队成员相同,并且它们目前正在工作,因此我不认为存在问题.

这是启动服务器时出现的错误

SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener 
java.lang.NoClassDefFoundError: javax/el/ELException
at org.apache.myfaces.webapp.AbstractFacesInitializer._createFacesContext(AbstractFacesInitializer.java:403)
at org.apache.myfaces.webapp.AbstractFacesInitializer.initStartupFacesContext(AbstractFacesInitializer.java:376)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:105)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: javax.el.ELException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 13 more

这些是行家清理/安装后的依赖

activation-1.1.jar
antlr-2.7.7.jar
aopalliance-1.0.jar
asm-3.3.1.jar
captcha-0.0.1-SNAPSHOT.jar
cmu_time_awb-0.0.1-SNAPSHOT.jar
cmu_us_kal-0.0.1-SNAPSHOT.jar
cmudict04-0.0.1-SNAPSHOT.jar
cmulex-0.0.1-SNAPSHOT.jar
cmutimelex-0.0.1-SNAPSHOT.jar
commons-beanutils-1.8.3.jar
commons-cli-1.2.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-digester-1.8.1.jar
commons-el-1.0.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.1.jar
commons-lang-2.6.jar
commons-logging-1.1.1.jar
commons-pool-1.5.4.jar
commons-validator-1.3.1.jar
cxf-api-2.7.0.jar
cxf-rt-bindings-soap-2.7.0.jar
cxf-rt-bindings-xml-2.7.0.jar
cxf-rt-core-2.7.0.jar
cxf-rt-databinding-jaxb-2.7.0.jar
cxf-rt-frontend-jaxrs-2.7.0.jar
cxf-rt-frontend-jaxws-2.7.0.jar
cxf-rt-frontend-simple-2.7.0.jar
cxf-rt-transports-http-2.7.0.jar
cxf-rt-ws-addr-2.7.0.jar
cxf-rt-ws-policy-2.7.0.jar
dom4j-1.6.1.jar
ejb3-persistence-1.0.2.GA.jar
en_us-0.0.1-SNAPSHOT.jar
freemarker-2.3.9.jar    
freetts-0.0.1-SNAPSHOT.jar
freetts-jsapi10-0.0.1-SNAPSHOT.jar
geronimo-javamail_1.4_spec-1.7.1.jar
hibernate-annotations-3.4.0.GA.jar
hibernate-commons-annotations-3.1.0.GA.jar
hibernate-core-3.3.1.GA.jar
javassist-3.4.GA.jar
javax.ws.rs-api-2.0-m10.jar
jaxb-impl-2.1.13.jar
jcaptcha-1.0-mod-0.0.1-SNAPSHOT.jar
jdom-1.1.jar
jettison-1.0.jar
jsf-facelets-1.1.6.jar
jta-1.1.jar
jtds-1.2.4.jar
junit-4.7.jar
jxl-2.6.12.jar
log4j-1.2.17.jar
mail-1.4.5.jar
myfaces-api-2.1.0.jar
myfaces-impl-2.1.0.jar
neethi-3.0.2.jar
oro-2.0.8.jar
primefaces-3.3.jar
slf4j-api-1.6.6.jar
slf4j-log4j12-1.6.6.jar
spring-aop-3.0.6.RELEASE.jar
spring-asm-3.0.6.RELEASE.jar
spring-batch-core-2.0.3.RELEASE.jar
spring-batch-infrastructure-2.0.3.RELEASE.jar
spring-beans-3.0.6.RELEASE.jar
spring-context-3.0.6.RELEASE.jar
spring-context-support-3.0.6.RELEASE.jar
spring-core-3.0.6.RELEASE.jar
spring-expression-3.0.6.RELEASE.jar
spring-jdbc-3.0.6.RELEASE.jar
spring-ldap-core-1.3.1.RELEASE.jar
spring-ldap-core-tiger-1.3.1.RELEASE.jar
spring-ldap-ldif-batch-1.3.1.RELEASE.jar
spring-ldap-ldif-core-1.3.1.RELEASE.jar
spring-ldap-odm-1.3.1.RELEASE.jar
spring-orm-3.0.6.RELEASE.jar
spring-test-3.0.6.RELEASE.jar
spring-tx-3.0.6.RELEASE.jar
spring-web-3.0.6.RELEASE.jar
stax2-api-3.1.1.jar
tomahawk-1.1.6.jar
velocity-1.6.2.jar
woodstox-core-asl-4.1.4.jar
wsdl4j-1.6.2.jar
xml-apis-1.0.b2.jar
xml-resolver-1.2.jar
xmlschema-core-2.0.3.jar
xpp3_min-1.1.4c.jar
xstream-1.3.jar

解决方法:

“ javax.el.E​​xpressionFactory”类属于“ el-api.jar”库,您可以从Maven*存储库下载它.

<dependency>
    <groupId>org.glassfish.web</groupId>
    <artifactId>el-impl</artifactId>
    <version>2.2</version>
</dependency>

并将其放在tomcat / lib目录中.

Alternative Solution

上一篇:java.lang.NoClassDefFoundError:org / apache / commons / lang3 / ObjectUtils


下一篇:HTTP状态500-处理程序处理失败;嵌套的异常是java.lang.NoClassDefFoundError: