javamonster
2011-09-02 10:44 阅读 579
已采纳

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条回答 默认 最新

  • 已采纳
    AngelAndAngel AngelAndAngel 2011-09-02 13:24

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

    点赞 评论 复制链接分享
  • freishlove freishlove 2011-09-02 10:47

    还有更多的错误信息没?

    点赞 评论 复制链接分享
  • freishlove freishlove 2011-09-02 10:49

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

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

    点赞 评论 复制链接分享
  • freishlove freishlove 2011-09-02 10:54

    [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下面没有?

    点赞 评论 复制链接分享
  • AngelAndAngel AngelAndAngel 2011-09-02 12:39

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

    点赞 评论 复制链接分享

相关推荐