Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Tags:

jsp

tomcat

I am working on a JSP project that uses Apache Tomcat 7.

When running the project on its loading index.html it's OK, but when trying to navigate to another page it's showing the error:

The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Please provide me a solution to get rid of this.

like image 996
RAVITEJA SATYAVADA Avatar asked Aug 15 '11 11:08

RAVITEJA SATYAVADA


1 Answers

Get rid of any servletcontainer-specific libraries such as jsp-api.jar in your /WEB-INF/lib folder. This exception indicates that you've put servletcontainer-specific libraries of a container which supports only Servlet 2.4 / JSP 2.0 or older in there (the getJspApplicationContext() method was introduced in Servlet 2.5 / JSP 2.1). This is a major mistake. Those libraries don't belong in the webapp's classpath.

Perhaps you did this to overcome project compilation errors, which is indeed a pretty common beginner's mistake. This should have been solved differently, you should refer the target runtime in your project, not copy some libraries of an arbitrary servletcontainer make/version into your project. It would make your project incompatible with servletcontainers of a different make and/or version.

See also:

  • How do I import the javax.servlet API in my Eclipse project?
like image 159
BalusC Avatar answered Sep 22 '22 06:09

BalusC