Quantcast
Channel: Crunchify
Viewing all articles
Browse latest Browse all 1037

jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

$
0
0

maven complexity

Are you getting below exception?

INFO: validateJarFile(c:\tomcat\Tomcat1\webapps\myApplication\WEB-INF\lib\servlet-api.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Even though this is INFO message I wanted to get rid off it.

The servlet api jar file must not be embedded inside the webapp since, obviously, the container already has these classes in its classpath: it implements the interfaces contained in this jar.

The dependency should be in the 

provided
 scope, rather than the default 
compile
 scope, in your Maven pom:
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

This resolved my issue.

The post jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class appeared first on Crunchify.


Viewing all articles
Browse latest Browse all 1037

Trending Articles