2 Replies Latest reply on Dec 29, 2011 11:25 PM by brentdouglas

    Classloading with multiple EARs

    mandarbk

      I have a couple of EARs deployed in JBoss 7 AS.

      App1.ear serves as a library to other EARs.

      App2.ear has following deployment XML,

       

      <jboss-deployment-structure>

                <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

                <deployment>

                          <dependencies>

                                    <module name="deployment.app1.ear" export="true" />

                          </dependencies>

                </deployment>


                <sub-deployment name="app2_ejb1.jar">

                          <dependencies>

                      <!-- Is it required ??? -->

                                    <module name="deployment.app1.ear" />

                          </dependencies>

                </sub-deployment>

      </jboss-deployment-structure>

       

      JBoss throws following exception while deploying the applications.


      Failed to load module: deployment.app2.ear.app2_ejb1.jar:main

      Caused by: org.jboss.modules.ModuleLoadException: Could not load module deployment.app1.ear:main as corresponding module spec service deployment.app1.ear:main was not found.


       

       

      If childEAR depends on parentEAR and if the dependencies are specified accordingly in the XML, I would expect subdeployments of childEAR to wait untill parentEAR is successfully & completely deployed.

      Does my understanding contradicts the JBoss 7 classloading architecture ?

       

      Can someone provide a solution ?

        • 1. Re: Classloading with multiple EARs
          brentdouglas

          I'm pretty sure can't specify that at the moment. I have the same problem. I got around it with a bash script that waits for a bit between deploying the first and second deployment. You could improve on that by looking at the deployment folder and examining the status of the first ear (.deployed, .pending, etc) and only deploy the second one once the first one is deployed.

           

          I just added a JIRA (https://issues.jboss.org/browse/AS7-3148) requesting this as it would be really handy.

          • 2. Re: Classloading with multiple EARs
            brentdouglas

            Whoops, I'm pretty sure I my brain ignored everything you said there and interpreted it as what I was thinking you were about to say . Sorry, I'm not familiar with your situation.