500错误:org.apache.jasper.JasperException: Unable to compile class for JSP:

来源:百度知道 编辑:UC知道 时间:2024/05/31 06:53:14
工具 MyEclipse 容器TOMCAT 6.X

加载 JSP页面出现 500错误 如下:
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 23 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet

把你的LoginServlet发出来

查一下你的目录,去掉servlet.jar,或者是旧版本的servlet-api.jar.
(http://mail-archives.apache.org/mod_mbox/tomcat-users/200710.mbox/%3C13019854.post@talk.nabble.com%3E)

这里有更多的解释:
>>If I recall correctly, in JSP spec 1.1, the argument for handlePageException() was Exception. In JSP spec 1.2 and later, the argument is Throwable.

It would appear you have a servlet.jar from Servlet 2.2/JSP 1.1 somehow becoming the jar this JSP is running
against, causing the method signature mismatch.
Make sure you don't have a copy of servlet.jar in the WEB-INF/lib of your webapp or somewhere else involved with the running server, such as in the lib/ext directory of your JDK or JRE.

In Tomcat 6, the JSP API classes are found in jsp-api.jar and servlet API classes are found i