Error 500: java.lang.NoClassDefFoundError: packageName/className
I have created a jsp page that has a form to get the attributes needed to create a Work Item, the jsp calls on the class to create the Item, but I ran into this error and researched multiple times with multiple sources but none solve the problem for me. can you please help, what to you need to see (code, web.xml, MANIFEST, server.xml... etc.)?
One answer
The NoClassDefFoundError indicates that the classloader , which is responsible for dynamically loading classes, cannot find the .class file for the class that you're trying to use. The definition of a class can be requested during a method call , or while creating a new instance using a new expression. NoClassDefFoundError means that the class is present in the classpath at Compile time, but it doesn't exist in the classpath at Runtime. After you compile your code, you end up with .class files for each class in your program. These binary files are the bytecode that Java interprets to execute your program.
Comments
Donald Nong
Jun 09 '17, 12:21 a.m.Full stack trace? We don't even know which component reports this error.
Raheem Alhamdani
Feb 22 '18, 12:38 p.m.Class loader order was the problem, I had to change to parent last and WAR class loader policy to "Single class loader for application.
I am including and loading Plain java jars with my war files, not the best practice I think.