Unable to compile class for JSP,求高手帮忙,在线等
我的dao代码没一点问题,在jsp页面中加了
<%
int rowCount=dao.getNum();
....
List=dao.getUserTable(pageSize,pageNow);
....
%>
然后,无论打开这个站点内任何其他jsp都出现下面这个:
org.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:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
求解释,求改写,求。。。各种求!!!!!!!
谢谢。。。。。。。。
------解决方案--------------------打开JSP编译的Java文件,看一下22行什么错误
------解决方案--------------------look tomcat\work\localhost\工程名\xxx_jsp.java line: 22
------解决方案--------------------因为项目中有像jsp-api.jar servlet-api.jar跟tomcat6的lib中同样的包,但版本比tomcat6的版本要低,在运行的时候,因为会优先加载项目中的包,所以产生了错误,把项目中和tomcat相同的包删除(必须删除,如果替换还会产生其他的错误),问题就可以解决了。
google到得
http://zhouhaitao.iteye.com/blog/985737
------解决方案--------------------jsp上页面的代码 全贴上来
原来的代码,不是jsp引擎生成的代码 !
------解决方案--------------------这提示的错误是JSP代码错误吧,这个页面没能正常编译成class。检查一下页面代码吧。
------解决方案--------------------直接访问dao.getNum()没有对应的Connection,PreparedStatement等对象
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.aiyiweb.com/j2ee/2308.html