Error 500: java.lang.NoClassDefFoundError: packageName/className
![]()
Raheem Alhamdani (28●1●6)
| asked Jun 08 '17, 12:26 p.m.
edited Jun 09 '17, 12:54 a.m. by Ralph Schoon (63.3k●3●36●46) 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. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Full stack trace? We don't even know which component reports this error.
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.