0

Error

INFO: validateJarFile(C:\Users\gopir\workspace\.metadata\.plugins\
      org.eclipse.wst.server.core\tmp2\wtpwebapps\hapi_hl7\WEB-INF\lib\
      servlet-api-2.5.jar) - jar not loaded.
      See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet  /Servlet.class

It means that servlet-api is already loaded. So duplication causing this issue.

If I am wrong, please correct me.

My Error

INFO: validateJarFile(C:\Users\gopir\workspace\.metadata\.plugins\
org.eclipse.wst.server.core\tmp2\wtpwebapps\hapi_hl7\WEB-INF\lib\
myApp.jar) - jar not loaded.
See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet  /Servlet.class

This is my error. Does it mean that myApp.jar is already added and trying to add it again is an error. Or servlet-api jar is dupliated.

Please help me to understand this.

Gibbs
  • 21,904
  • 13
  • 74
  • 138
  • Possible duplicate http://stackoverflow.com/questions/15601469/jar-not-loaded-see-servlet-spec-2-3-section-9-7-2-offending-class-javax-serv – Kalyan Chavali Jul 03 '15 at 04:38

1 Answers1

0

A war can't contains jar related to servlets.

Remove servlet-api-2.4.jar from WEB-INF/lib to solve this problem.

It happens because the servlet container (tomcat, jetty, jboss...) has it's own servlet-api.jar and you can't override it.

If you are using maven try this

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>YOUR_SERVLET_VERSION</version>
    <scope>provided</scope>
</dependency>

The provided scope inform that the jar must be excluded from the war at package time.

Davide Lorenzo MARINO
  • 26,420
  • 4
  • 39
  • 56