2 Replies Latest reply on Mar 1, 2003 10:37 AM by drapp

    Russian Doll Packaging

    drapp

      I have a question regarding the "russian doll" mode of packaging. Its my understanding that I can include xAR in any other xAR (excluding WARs).

      I have an EAR that contains a WAR, several EJB jars and some third party jars that are used by both classes in the WAR and in the EJB jars. If I package the third party jars in the EAR as peers to the WAR and EJB jars, I receive a java.lang.NoClassDefFoundError upon deployment of the EAR (during initialization of the Jetty Web Container). If, instead, I deploy the third party jars directly to the deploy directory, everything is fine.

      Have I misunderstood the capabilities of the "russian doll" packaging model?

      --Dan

      P.S. This is on JBoss 3.0.6

        • 1. Re: Russian Doll Packaging
          raja05

          IF you have the jar, war and 3rd party as peers,
          Create a manifest file for your jar and include a classpath entry in the manifest which points to the third party jar. Something like
          Class-path: <my3rdpartyjar.jar>
          This way, when you package ur jar, war and 3rd party jars in a ear, the ejb could find the 3rd party jar as its in manifest and the web could also get it because of the parent ejb class loader.

          If you have the 3rd part jar in deploy dir directly,the jboss unified class loader would load ur jar and all the ejb, war would be able to use it!

          -Raj

          • 2. Re: Russian Doll Packaging
            drapp

            Ok. This is what I've tried.

            I created a jar (a.jar) in which I've placed all other third party jars, the application depends on (russian doll packaging). I have an ejb jar (b.jar) that references a.jar via Class-path in the manifest. I have a war (c.war) that also references a.jar via Class-path in the manifest.

            One of the classes that exists only in c.war depends on one of the classes in a.jar.

            When I deploy this EAR in jboss 3.0.4 it starts properly, when I delopy it in jboss 3.0.6 it fails with NoClassDefFoundError for a class that exists in a.jar (during web container initialization)

            For the time being I'm deploying a.jar directly to the deploy directory and all works fine. I'm curious about this behavior however. Any thoughts/suggestions?