Skip to main content

Getting class from ear/war in ear/lib/jar returns ClassNotFoundException

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2013-01-05

Hello everybody!
My project structure is the following. Server is Glassfish 4. IDE - netbeans 7.4. Project temp is used by project a.

+ lib/temp.jar
+ a.war

Temp.jar contains core classes. They are used by war. Temp.jar doesn't import any files from war, and it must know about war nothing. But, temp.jar has classes that creates instances of war classes by reflection (according to xml file). Here I get ClassNotFoundException. How can it be fixed? Is it possible to fix or I have wrong project structure?

Note: I didn't put temp.jar in a.war as there can be different war files that can use this jar.