Liming
Liming

Reputation: 1661

Glassfish 3: Why do I have to deploy all my libraries into domains/lib/ to get it to work?

I just got handed over a project from another group. EJB session bean / web service. It deployed without any issue on JavaCAPS 6.

However, on Oralce Glassfish V3 (3.0.1 Build 22), when I deployed the jar file (Applicaton / EJB Module), it kept complaining certain external libraries (which is included in the jar), can not be found.

Error in annotation processing: java.lang.NoClassDefFoundError: org/apache/commons/vfs/FileSystemException|#]

The Apache VFS jar is in the jar, but it can't find it.

However, if i move the jar and its dependencies into $Glassfish home/domains/domain1/lib

Everything is fine.

What are we doing wrong here?

Thanks

Upvotes: 1

Views: 2811

Answers (1)

Yusuf K.
Yusuf K.

Reputation: 4250

In v2.* the root level library jars of the ejb module supported but because of JAVA EE 6 security restriction, glasssfish V3.1 NOT supported jar libs within ejb-jar module(*.jar file) to deploy. So you could use compatibility=v2 property to deploy

For example;

asadmin {server_parameters} deploy --property compatibility=v2 {package}.jar 

Workaround Note: in Glassfish V3.0 there is no support for compatibility property. Must upgrade V3.1 or put libs to {GlassfishHome}/lib directory

Upvotes: 2

Related Questions