-2

INFO: validateJarFile(E:\JavaProjectPractic.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\KKWebSite\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class

Samar
  • 19
  • 1
  • 5
  • You'll have to add more information about the issue you are seeing so we can properly diagnose it. – Cory Klein Sep 30 '14 at 16:54
  • i am doing it simply with jsp servlet. if i delete servlet api from lib it generates error in my servlet page, – Samar Sep 30 '14 at 16:58
  • Probably a duplicate of http://stackoverflow.com/questions/1993493/error-servlet-jar-not-loaded-offending-class-javax-servlet-servlet-class – Raedwald Feb 13 '15 at 13:04

1 Answers1

2

You should not put servlet-api.jar in the WEB-INF/lib directory of your web application. The Servlet API is supplied by the servlet container.

Remove servlet-api.jar from the WEB-INF/lib directory of your web application.

If your project is a Maven project and you have a dependency on servlet-api.jar, then set the scope of the dependency to provided. An example of how that would look in your pom.xml:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    <scope>provided</scope>
</dependency>
Jesper
  • 202,709
  • 46
  • 318
  • 350
  • nope i am doing it simply with jsp servlet, and if i remove the servlet-api it shows error in my servlet in extends – Samar Sep 30 '14 at 16:57
  • You need `servlet-api.jar` in the classpath when you **compile** the project, but you must not have it in there when you run it in a servlet container. – Jesper Sep 30 '14 at 16:57
  • can u please explain it more.. cause i m having this problem so many time when i starts my new project in eclipse. – Samar Sep 30 '14 at 17:03