Simon Voggeneder
Simon Voggeneder

Reputation: 387

How to resolve java.lang.NoClassDefFoundError?

I'm currently working on a simple web project, for which I am using the SDK of Polarion. When trying to work with the according *.jar-Files, Tomcat 7 throws the following error message on start-up:

SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.NoClassDefFoundError: Lcom/polarion/alm/ws/client/session/SessionWebService;

According to the research I have undertaken, Java is trying to find an instance of com.polarion.ws.client.session.SessionWebService (thus the leading L). I have checked the classpath for the needed entry - it's there.

C:\Polarion\polarion\SDK\lib\com.polarion.alm.ws.client\wsclient.jar

As of now, I've run out of ideas what could have gone wrong. Do you have any ideas?

Thanks a lot! Simon

Upvotes: 0

Views: 3971

Answers (2)

Gursel Koca
Gursel Koca

Reputation: 21300

Deployment and compilation are different processes. You should be aware of that, you can compile but if the necessary libraries are not accessible by the deployed application , you would get this exception.. As previous answer suggests, you should put necessary libraries WEB-INF/lib directory of your web application..

Upvotes: 2

Robin Green
Robin Green

Reputation: 33103

You are not supposed to put libraries for use in webapps in the CLASSPATH. You are supposed to put them in WEB-INF/lib in your webapp.

Upvotes: 7

Related Questions