tomcat6启动异常

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

An error occurred at line: 23 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)


在别人那边正常的项目,放到本机就出现这问题.查看看tomcat work目录下的jsp文件.确认为jar包冲突.

原因是把项目lib 下包含servlet-api.jar与jsp-api.jar。但和tomcat/lib/下的版本不一样.从文件大小可查看.造成启动正常.但一触发响应事件,抛出异常.虽是小问题,记录下,省的浪费时间下次.

你可能感兴趣的:(java,apache,tomcat,jsp,servlet)