The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
程序员文章站
2022-07-15 13:25:47
...
错误信息
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: 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:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.
Apache Tomcat/6.0.24
解决方案
因为项目中有像jsp-api.jar servlet-api.jar跟tomcat6的lib中同样的包,但版本比tomcat6的版本要低,在运行的时候,因为会优先加载项目中的包,所以 产生了错误,把项目中和tomcat相同的包删除(必须删除,如果替换还会产生其他的错误),问题就可以解决了。
推荐阅读
-
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
-
The method setBuiltInZoomControls(boolean) is undefined for the type MapView
-
The method getDispatcherType() is undefined for the type HttpServletRequest
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js
-
The method getJspApplicationContext(ServletContext) is undefined for the type
-
The method getServletContext is undefined for the type HttpServletRequest
-
android开发:The method getSupportFragmentManager() is undefined for the type
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js