-1

I am running a JSP/Servlet Web application and out of nowhere we experienced some random problems that don't make any sense. I checked the catalina.out file to check the log files, and I noticed it contained some of the following messages

    SEVERE: Error starting static Resources
            java.lang.IllegalArgumentException: Invalid or unreadable
            WAR file : error in opening zip file

         INFO: validateJarFile(/home/weremo/appservers/
           apache-tomcat-6.0.26/webapps   /WMA/WEB-INF/lib/
           servlet-api.jar) - jar not loaded. See Servlet Spec 
           2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

I am aware of what this message means, but am in the dark as to what could have caused it, or what effects it could have on the application.

TheJediCowboy
  • 8,924
  • 28
  • 136
  • 208
  • 1
    Hmm, is it possible to try to download another copy of the servlet-api.jar file? It looks like the Servlet.class file is malformed. Or is there even a servelet-api.jar file in your war file? – Chris Thompson Apr 27 '10 at 04:34
  • Or better yet, just zap it as mdma suggests... – Chris Thompson Apr 27 '10 at 04:42
  • possible duplicate of [Error: Servlet Jar not Loaded... Offending class: javax/servlet/Servlet.class](http://stackoverflow.com/questions/1993493/error-servlet-jar-not-loaded-offending-class-javax-servlet-servlet-class) – Raedwald Feb 13 '15 at 13:11

1 Answers1

4

Make sure that the servlet-api.jar file is not included in your webapp, if it is, just remove it.

The servlet api is provided by the servlet container. Webapps are not allowed to load classes in the javax.servlet package, and that's what's causing the error.

mdma
  • 56,943
  • 12
  • 94
  • 128
  • the servlet-api.jar file is included in my WEB-INF/lib directory. Am I supposed to remove it from the lib directory completely? – TheJediCowboy Apr 27 '10 at 04:57
  • That's correct. You don't want to see WEB-INF/lib/servlet-api.jar in your webapp. – mdma Apr 27 '10 at 05:02