java.lang.NoClassDefFoundError: javax/el/ELResolve

黄平俊 发布于 2009/03/17 16:50
阅读 17K+
收藏 0

所用环境:JDK1.6.0_11  +  tomcat-6.0.18

从Apache下载了新的Tomcat后,启动时报:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
 org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

root cause

java.lang.NoClassDefFoundError: javax/el/ELResolver
 java.lang.ClassLoader.defineClass1(Native Method)
 java.lang.ClassLoader.defineClass(ClassLoader.java:621)
 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
 java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
 java.net.URLClassLoader.access$000(URLClassLoader.java:56)
 java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 java.security.AccessController.doPrivileged(Native Method)
 java.net.URLClassLoader.findClass(URLClassLoader.java:188)
 java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 java.lang.ClassLoader.loadClass(ClassLoader.java:300)
 java.lang.ClassLoader.loadClass(ClassLoader.java:252)
 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:200)
 org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
 org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
 org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
 org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

root cause

java.lang.ClassNotFoundException: javax.el.ELResolver
 java.net.URLClassLoader$1.run(URLClassLoader.java:200)
 java.security.AccessController.doPrivileged(Native Method)
 java.net.URLClassLoader.findClass(URLClassLoader.java:188)
 java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 java.lang.ClassLoader.loadClass(ClassLoader.java:252)
 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 java.lang.ClassLoader.defineClass1(Native Method)
 java.lang.ClassLoader.defineClass(ClassLoader.java:621)
 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
 java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
 java.net.URLClassLoader.access$000(URLClassLoader.java:56)
 java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 java.security.AccessController.doPrivileged(Native Method)
 java.net.URLClassLoader.findClass(URLClassLoader.java:188)
 java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 java.lang.ClassLoader.loadClass(ClassLoader.java:300)
 java.lang.ClassLoader.loadClass(ClassLoader.java:252)
 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:200)
 org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
 org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
 org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
 org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
从网上查了N多资料,就是没找着正确的解决办法。

如下方法都试过,行不通:

1、el-ri.jar,el-api.jar复制到tomcat的lib中,启动后还是报错!

2、从Apache下重新下载Tomcat(6.0.18),没作任何的修改~~~,启动后仍然报错~~~

郁闷呐~~~Frown 谁来解决一下~~~~

 

 

加载中
0
黄平俊
黄平俊

终于找着原因了~~~~

原因:在Eclipse的Windows -->> Preference  -->>Tomcat 设置Tomcat Home路径后,又在Tomcat的Advanced选中设置了相同的Tomcat Base路径,关键一步是Advanced下有项:Add Java projects to tomcat classpath,勾上所选项目之后,才可以正常的引起javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver 

解决办法:从哪里勾上的,就从哪里勾回去,把Add Java projects to tomcat classpath勾掉。

0
红薯
红薯

是空的Tomat 还是跑了什么应用啊?

0
L
Leshnn

看看是不是跟jdk的版本不匹配,换成1.5的试试看。

0
h
husituo108

其实对于这个问题,到根上就是:

    没有把classpath配置好.

    你可以试一下把el-api.jar包加到原有的classpath中.

这样就不会出现这种异常了.它出现 的原因就是 : 没有找到java.lang.NoClassDefFoundError: javax/el/ELResolver 类,

所以给它加上就OL.嘻嘻

0
王海龙
王海龙
maven 编译时选了jdk6.而没选jdk7 ,及jdk版本不同或者jdk安装的有问题也会导致此类问题。这里类应该在tools.jar 里
0
返回顶部
顶部