JasperException: Unable to compile class for JSP

场景:SSH框架搭建

报错信息:

JasperException: Unable to compile class for JSP

---------------------------------------------------------------------------

HTTP Status 500 - Unable to compile class for JSP:


type Exception report

message Unable to compile class for JSP:

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

exception

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

An error occurred at line: [34] in the generated java file: [C:\Program Files\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\SSH\org\apache\jsp\Fail_jsp.java]
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Stacktrace:
	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:490)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.72 logs.


处理方式:

删除...\Tomcat 7.0\webapps\SSH\WEB-INF\lib\下javax.servlet.jar、javax.servlet.jsp.jar这两个jar包即可

删除后如果还不生效,可能是缓存问题,需要清除tomcat缓存文件...\Tomcat 7.0\work\Catalina

你可能感兴趣的:(SSH框架相关)