Solution for exceptions reported by JspFactory after deployment in Tomcat

Source: Internet
Author: User

The method getJspApplicationContext (ServletContext) is undefined for the type

Causes of JspFactory exceptions and solutions:

Is because of the Project WEB-INF/lib under the existence of jsp-api.jar, servlet-api.jar, and Tomcat built-in jar package conflict caused.

Solution:

Remove jsp-api.jar, servlet-api.jar in the web Project Lib directory and restart Tomcat service issue resolution.

When creating a project, both the jsp-api.jar and servlet-api.jar jar packages do not need to be manually added to the web project, which is included in Tomcat.

The exception information is as follows:

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. Compiler (compiler. java: 308)
Org. apache. jasper. compiler. Compiler. Compiler (compiler. java: 286)
Org. apache. jasper. compiler. Compiler. Compiler (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)

So the existing jar in Tomcat does not need to be included in the project during Tomcat deployment to avoid conflicts.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.