cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to access classes in third party jar files packaged with my ejb.jar

Former Member
0 Kudos

I have packaged some third party jar files in my xxx_ejb.jar file. The third party jar file contains classes that are accessed by some custom classes which are in turn accessed by my bean classes. I get the following error when my custom classes attempt to use any of the classes in one of the third party jar files:

java.lang.NoClassDefFoundError: com/Ostermiller/util/CSVParser

Shouldn't I be able to access classes in jar files that are packaged with my xxx_ejb.jar file? I see the xxx_ejb.jar file as a resource of the application classloader that contains it but I don't see the third party jar files.

Accepted Solutions (0)

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

As per the Java EE specification, additional JAR files should be packaged on the EAR level. Only WAR files' WEB-INF/lib folder is scanned for JAR files to be added to the classloader.