简体   繁体   中英

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

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.

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..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM