简体   繁体   中英

NoClassDefFound error in web application deployed on Tomcat

I am new to Java and trying to develop a Java web application with a feature to browse the server's file system. The functionality works fine when I run the application in Eclipse but if I generate a WAR file (via "Export as WAR" in Eclipse) and deploy on Tomcat 7, it throws a NoClassDefFound error.

I have placed the required jar in the WEB-INB/lib folder and also noticed the jar is available after deployment.

first check your BuildPath. Your jars are added to build path are not. check with this link

Without the Exception trace can't provide more details, but try the following:

  • Review the java.lang.NoClassDefFoundError error and identify the missing Java class.
  • Verify and locate the missing Java class from your compile / build environment. -Determine if the missing Java class is from your application code or third part API.
  • Go to Properties on your Project (right click) > Java Build Path > Order and Export . Check all needed librarys are included.

Hope this helps.

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