views:

44

answers:

1

I'm trying to deploy an ear containing an ejb application into a weblogic 9.2 server.

This ear is created using maven (itself using the ear ant task). Maven produces the following structure:

myApp.ear
 - META-INF
   - application
   - MANIFEST.MF
 - dependency-1.jar
 - dependency-2.jar
 - ...
 - dependency-n.jar
 - myEjb.jar

The manifest contains a Class Path section that is looking good (all dependencies jar are listed)

When I try to deploy the ear I get a NoClassDefFoundError exception.

If I put all my jars in the lib dir of my domain, the ear is successfully deployed.

If I put all my jars in a dir called APP-INF/lib (the weblogic standard), the ear is successfully deployed too.

myApp.ear
 - META-INF
   - application
   - MANIFEST.MF
 - APP-INF
   - lib
     - dependency-1.jar
     - dependency-2.jar
     - ...
     - dependency-n.jar
 - myEjb.jar

In the same project, I have others ears that does not use the APP-INF/lib dir that are working perfectly.

Does someone has an idea of why weblogic is not able to deploy my ear ?


After some investigation I've found the problem source: it was the manifest class-path of the myEjb.jar module. See comment in accepted response.

Thanks a lot.

+1  A: 

The standard approach for dependency jars within an EAR is to put them in the APP-INF/lib as given on the documentation

http://download.oracle.com/docs/cd/E13222_01/wls/docs81/programming/environment.html#1099434

I suspect the problem in your first EAR is in the actual classpath entries in your Manifest.mf

see the Manifest Class-Path section on http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/classloading.html#wp1065667

The manifest Class-Path entries refer to other archives relative to the current archive in which these entries are defined

Are there any sub-directories or relative path incorrect?

JoseK
Thanks JoseK. I've learned that the ear with the APP-INF/lib is the weblogic standard. But my build system produces ear without this dir. The produced manifest is also looking good. And the strangest fact is other ear build with the same tool are working fine.
Guillaume
@Guillaume: I'm wondering whether any of the dependency jars has a dependency on another bundled dependency - hence causing issue?
JoseK
@Josek. I've found the problem: it was a Manifest Class-Path problem on the ejb.jar module, not in the ear's META-INF/MANIFEST Class-Path. Thanks a lot for your help.
Guillaume