Hi Bernhard,
Change Class-Path: lib/lib1.jar lib/lib2.jar classes to Class-Path:
lib/lib1.jar lib/lib2.jar classes/
Another point is, in Java EE 6, EAR/lib/ is the default EAR
library-directory and all jars in that directory are automatically made
available to your application. Having them also in Class-Path results
in duplicates but that should affect functioning.
-cheng
On 11/29/11 5:13 AM, Bernhard Thalmayr wrote:
> Hi experts,
>
> classloading and 'portable JEE application' seems to be very
> challenging in GF 3.1.1
>
> I have a (3rd party) enterprise app with layout
>
> META-INF/application.xml
> ejb1.jar
> |_ META-INF/MANIFEST.FM <http://MANIFEST.FM> (Class-Path: lib/lib1.jar
> lib/lib2.jar classes)
>
> ejb2.jar
> |_META-INF/MANIFEST.FM <http://MANIFEST.FM> (Class-Path: lib/lib1.jar
> lib/lib3.jar classes)
>
> lib/lib1.jar
> lib/lib2.jar
> lib/lib3.jar
> classes/<package-structure>
>
> A 'NoClassDefFoundError' is raised
>
> java.lang.NoClassDefFoundError: <class-from-classes-directory>
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
> at
> com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader
> .java:756)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:410)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:410)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:186)
> at <method-of-class-from-ejb1.jar>
>
>
> As far as I interpret chapter 'EE.8' of JEE 6 specification I packaged
> the appliation correctly.
>
> Could it be that GF 3.1.1 does not honour directories mentioned in
> MANIFEST.FM <http://MANIFEST.FM> ?
>
> Section 8.2.1 states ...
>
> "The Java EE deployment tools must process all such referenced files
> and directories when processing a Java EE module."
>
> Thanks for any pointers.
>
> -Bernhard
> --
> IT-Consulting Bernhard Thalmayr
> - Painstaking Minds -
> 83620 Vagen (Munich area)
> Germany