Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does offending class tell me on server startup?

Tags:

java

tomcat

I'm having the jee7 web api as dependency. I can start my app on tomcat application successfully, but what does the following "offending class" statements tell me? Do I have to take any actions?

Jan 13, 2014 5:47:47 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
Information: validateJarFile(C:\Users\me\Servers\apache-tomcat-7.0.50\wtpwebapps\app\WEB-INF\lib\el-api-2.2.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class
Jan 13, 2014 5:47:47 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
Information: validateJarFile(C:\Users\me\Servers\apache-tomcat-7.0.50\wtpwebapps\app\WEB-INF\lib\javaee-web-api-7.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class

pom.xml

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>7.0</version>
    </dependency>
like image 927
membersound Avatar asked Jan 13 '14 16:01

membersound


3 Answers

It seems like you (your Servlet container) are trying to load some classes that have already been loaded. The servlet-api and el-api should be provided by the Servlet container.

Change your pom.xml to account for that

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-web-api</artifactId>
    <version>7.0</version>
    <scope>provided</scope>
</dependency>
like image 63
Sotirios Delimanolis Avatar answered Oct 16 '22 05:10

Sotirios Delimanolis


I have faced the same issue during a project using Eclipse.

Doing below things resolved the issue

  1. Added javax.*.jar to the build path
  2. Removed the project - gave clean build and add the project and finally published....!!

Bingo...!!

This resolved my issue. Hope this helps.

Thanks,

mskr.

like image 21
Siva Kameswara Rao Munipalle Avatar answered Oct 16 '22 03:10

Siva Kameswara Rao Munipalle


This is a very common problem for developers who are using Maven as a build tool. when , we include the servlet-api as a project dependency i.e pom.xml like this :

<dependency>
<groupId>  javax.servlet</groupId>

<artifactId>servlet-api</artifactId>
<version>2.5</version>

add scope as provided in the above dependency as following .

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
like image 43
Vijay Bhatt Avatar answered Oct 16 '22 05:10

Vijay Bhatt