4

Deployed a webservice on tomcat 7.0. Getting error on accessing application or even the tomcat home page which is the root app.

HTTP Status 500 - java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;

type Exception report

message java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:343)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause

java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
    org.apache.jasper.compiler.Validator$ValidateVisitor.<init>(Validator.java:514)
    org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1798)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.

Tomcat Log

Jul 16, 2013 9:30:57 PM org.apache.catalina.core.StandardWrapperValve invoke
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.jasper.compiler.Validator$ValidateVisitor.<init>(Validator.java:514)
        at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1798)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)



   <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
        <servlet-name>FinServlet</servlet-name>
        <servlet-class>finanalytic.servlets.FinServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>FinServlet</servlet-name>
        <url-pattern>/FinServlet</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>

Tomcat lib folder

ls /usr/lib/apache-tomcat-7.0.42/lib
annotations-api.jar  FastInfoset.jar           jaxb-api.jar   jaxws-tools.jar     resolver.jar      tomcat-coyote.jar   woodstox-core-asl.jar
catalina-ant.jar     gmbal-api-only.jar        jaxb-core.jar  jsp-api.jar     saaj-impl.jar     tomcat-dbcp.jar
catalina-ha.jar      ha-api.jar            jaxb-impl.jar  jsr181-api.jar      servlet-api.jar   tomcat-i18n-es.jar
catalina.jar         jasper-el.jar         jaxb-jxc.jar   log4j.properties    stax2-api.jar     tomcat-i18n-fr.jar
catalina-tribes.jar  jasper.jar            jaxb-xjc.jar   management-api.jar  stax-ex.jar       tomcat-i18n-ja.jar
ecj-4.2.2.jar        javax.annotation-api.jar  jaxws-api.jar  mimepull.jar    streambuffer.jar  tomcat-jdbc.jar
el-api.jar       javax.xml.soap-api.jar    jaxws-rt.jar   policy.jar      tomcat-api.jar    tomcat-util.jar

App lib folder

ls /usr/lib/apache-tomcat-7.0.42/webapps/finClient/WEB-INF/lib
hbase-0.94.6-cdh4.3.0-security.jar  http.jar
ritesh
  • 907
  • 3
  • 11
  • 31
user2475661
  • 39
  • 1
  • 1
  • 3
  • What is your web.xml or context.xml look like? Please provide more details that could us help you. – dougEfresh Jul 16 '13 at 21:44
  • @dougEfresh Edited the post with web.xml details. BTW, we wrote the code using Netbeans and Glassfish. Later trying to deploy on Tomcat. Copied JAXWS libs to tomcat lib folder also. – user2475661 Jul 17 '13 at 00:23
  • http://localhost:8080/manager/html is working. Infact even the tomcat page is giving the same error which I recieve from app homepage. – user2475661 Jul 17 '13 at 01:22
  • what does your pom.xml look like? I noticed you are using hbase. When trying a similar simple web app with maven i found this pom.xml to fix the issue: http://stackoverflow.com/questions/14704861/spring-maven-hadoop – Miguel Pereira Oct 22 '13 at 22:48
  • Possible duplicate of [How do I import the javax.servlet API in my Eclipse project?](http://stackoverflow.com/questions/4076601/how-do-i-import-the-javax-servlet-api-in-my-eclipse-project) – BalusC Mar 09 '16 at 08:23

3 Answers3

1

Just googled and found the library jar files are in your web app folder (webcontent/lib) which mismatch with the apache server servlet container lib files. If you copied any tomcat jar files into your web app folder just delete them as it is already present in tomcat server library.

0

Definitely library file mistmatch with compiled code and what container has..

http://mydailygyaan.blogspot.com/2012/11/http-status-500-javalangabstractmethode.html

Remove your application and take out all the jars you added in to the tomcat lib folder..one of your library files is not compatible with Tomcat library files.. Once tomcat home page shows up, add your application and go after the library file one after other..

Arun
  • 1
0

you need to add tomcat jasper jar to your class path http://grepcode.com/snapshot/repo1.maven.org/maven2/org.apache.tomcat/tomcat-jasper/7.0.55/

I faced the same issue but with embedded tomcat and fixed it by adding below dependancy to pom file

    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
    </dependency>
Bassem Reda Zohdy
  • 12,662
  • 3
  • 33
  • 39