The server encountered an internal error () that prevented it from fulfilling this request.求点解typeException reportmessagedescriptionThe server encountered an internal error () that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException:Unable to compile class for JSP:An error occurred at line:22 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory Stacktrace:o
The server encountered an internal error () that prevented it from fulfilling this request.求点解
typeException report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exceptionorg.apache.jasper.JasperException:Unable to compile class for JSP:An error occurred at line:22 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:308) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:273) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
noteThe full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.
The method getJspApplicationContext(ServletContext) is undefined for the type
JspFactory的异常的原因及解决办法原因:
是由于工程的WEB-INF/lib下存在jsp-api.jar、servlet-api.jar,与Tomcat自带的jar包冲突造成的.
解决办法:
删除WEB工程Lib目录中的jsp-api.jar、servlet-api.jar,重新启动Tomcat服务问题解决.
在创建工程时,jsp-api.jar、servlet-api.jar这两个jar包都无需手工加入到web工程中,Tomcat中都已包含.