Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

When Running dynamic WebApplication This Exception Showing  RSS feed

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;] with root cause
java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
at org.apache.jsp.index_jsp._jspInit(
at org.apache.jasper.runtime.HttpJspBase.init(
at org.apache.jasper.servlet.JspServletWrapper.getServlet(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.valves.AccessLogValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the JavaDocs for java.lang.AbstractMethodError, this error must be due to incompatibility between the version of Java used to compile the class and the version executing the application.

(amazing what you can learn from the JavaDocs)
Posts: 1843
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you would also see this sort of error if you have multiple different versions of the servlet api in your classpath.

If your WEB-INF/lib directory contains jar files with javax.servlet.* classes, they shouldn't be there.
eg servlet-api.jar, jsp-api.jar

JspApplicationContext was introduced with JSP2.1 spec (Tomcat 6+), so if you have an older version of the API lying around, that would cause the problem.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!