错误描述:
程序运行报错:java.lang.NoClassDefFoundError:javax/el/ELResolver
刷新页面又会报错:java.lang.NoClassDefFoundError:Could not initialize class org.apache.jasper.el.ELContextImpl
然后test其他程序,发现包含El表达式都会报错...
借鉴下第一个错误解决方法,内容如下:(但是并没有什么用...)
ype Exception report
message java.lang.NoClassDefFoundError: javax/el/ELResolver
description The server encountered an internal error that prevented it fromfulfilling this request.
exception
javax.servlet.ServletException:java.lang.NoClassDefFoundError: javax/el/ELResolverorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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)sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)java.lang.ClassLoader.loadClass(ClassLoader.java:307)java.lang.ClassLoader.loadClass(ClassLoader.java:300)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:209)org.apache.jsp.NewFile_jsp._jspInit(NewFile_jsp.java:22) org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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)sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)java.lang.ClassLoader.loadClass(ClassLoader.java:307) 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)sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)java.lang.ClassLoader.loadClass(ClassLoader.java:307)java.lang.ClassLoader.loadClass(ClassLoader.java:300) 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:209)org.apache.jsp.NewFile_jsp._jspInit(NewFile_jsp.java:22)org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the rootcause is available in the Apache Tomcat/6.0.36 logs.
报这个错,调试了两个多小时,郁闷死了。
解决办法:到apache-tomcat/lib目录下,拷贝el-api.jar放到D:\Java\jdk1.6.0_11\jre\lib\ext下即可
借鉴下第二个错误解决方法,内容如下:(但是依然没有什么用...)
EL表达式的错误
解决方案1:
当项目中引用tomcat目录下面的lib下面的catalina.jar的时候,用myeclipse将项目部署到tomcat下面的时候,会将catalina.jar包加到项目的web-inf下面的lib文件夹下面,这样这个包就会和tomcat下面的lib下面的catalina.jar包冲突会报java.lang.ClassCastException:org.apache.catalina.util.DefaultAnnotationProcessor错误,解决方法是将项目部署到tomcat下面后,将项目的web-inf/lib下面的catalina.jar删掉,然后在重启tomcat,ok。
方案2:
修改了tomcat里的context.xml文件,在context 元素下添加
<Context>
<Loaderdelegate="true" />
以上解决方法均免疫…
然后重装jdk
不报错了…不报错了….
---------------------------------------------------------------------------------------------------------------------------------
新人小白,虽然不知道为什么报错(猜测可能是jdk虽少什么jar包),有知道的大大请多多指教,ありがとう~
解决方法仅供参考(就喜欢粗暴直接的...)