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

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

An error occurred at line: 28 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:95)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:473)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:466)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:315)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:179)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

刚开始编译的好好的。。项目能正常运行。。我重新部署了一下项目就报这个错误了。。。项目没坐任何修改。这是怎么回事啊。。麻烦各位解释一下

5个回答

[quote]恩。。work下面相关文件夹里面是存储的你jsp被编译之后的java文件和class文件的。。。但是我就是不明白为什么报那个错。。。 [/quote]
那是因为你myeclipse没有即使给你发布版本(myeclipse毕竟也是个程序,有时也会阻塞),有时会出现这种状况,不必担心。有时候生成的session副本也会放在work下面,有时也会手动删除,不要紧的。

还有更多的错误信息没?

[quote]The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory[/quote]
有可能是jar冲突

工程的lib下面有没有
jsp-api-xx.jar,servlet-api-xx.jar?删掉

[quote]freish 写道
引用
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

有可能是jar冲突

工程的lib下面有没有
jsp-api-xx.jar,servlet-api-xx.jar?删掉

没有[/quote]

确定部署到web容器后的web-inf/lib下面没有?

[quote]可以了。。我把Tomcat的work文件夹删了。。重新部署了一下项目就好。。。但是我不知道什么原因。。。求解 [/quote]
是编译出问题了,work下面相关文件夹里面是存储的你jsp被编译之后的java文件和class文件,你可以自己去看看。
你删除掉之后,又重新编译了一份完整的进去了,所以成功了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问