7 Replies Latest reply on Mar 13, 2006 5:21 AM by tylerdurden001

    deployment order of ejb modules, how?

    obender

      This question had been asked many timeы here (directly or indirectly) but so far no answer was given.
      So I've decided to try again.

      Is there a way to specify an order in which EJB modules will be deployed?

      Apparently JBoss (unlike WebSphere for example) ignores an order in which EJB modules are specified in application.xml. So there is no way to make sure that ebjA.jar module will be deployed before ejbB.jar.

      Some people here suggested use of jboss.xml for the given ejb-jar.xml and use its depends attributes to specify
      dependency on JMX object there. It doesn't seem to work either.

      Could you please shed some light on this?

        • 1. Re: deployment order of ejb modules, how?
          leathurman

          Hi OBender,

          We are using JBoss 3.0.6 and do order the deployment of the ears by:

          1. Amend jboss-service.xml in server//conf to use the PrefixDeploymentSorter. (If you do a search for 'prefix' there is a good explanation of how this deployment sorter works.

          2. We prefix the name of ear with its level in our hierarchy, i.e an ear with 01-parent.ear gets deployed before all 02-child.ear

          Just had a look in the 3.2.3 config and the same options seem to be available in server//conf

          Regards
          Lea.

          • 2. Re: deployment order of ejb modules, how?
            obender

            Unfortunately this is not an option for me since I have to manage dependencies inside one ear among multiple ejb jar files.
            I had to modify JBoss code to make it work for me...

            • 3. Re: deployment order of ejb modules, how?
              starksm64

              Right, we don't consider the order of the application.xml modules as important. I don't see a problem with honoring this ordering though. Submit your patch for the ordering to sourceforge and I'll look to integrate it.

              http://sourceforge.net/tracker/?group_id=22866&atid=376687

              You should be able to control ejb to ejb deployment ordering using dependices. What was an example that did not work?

              • 4. Re: deployment order of ejb modules, how?
                obender

                Dependencies that one can specify in jboss.xml didn't work (at least for me).
                I was trying to make those like this
                jboss.j2ee:jndiName=MyBeanName,service=EJB
                To make the given EJB depend on one MyBean

                The fix is rather trivial and I'm not sure if I should put it on sourceforge.net.

                It's one line change for
                jboss.jar!org.jboss.deployment.J2eeApplicationMetaData
                where:
                final Collection modules = new HashSet();
                should be replaced by the
                final Collection modules = new ArrayList();

                • 5. Re: deployment order of ejb modules, how?
                  starksm64

                  I have applied the change for 3.2.6RC2+

                  • 6. Re: deployment order of ejb modules, how?
                    suthakar

                    Hi Scott,

                    I'm placing my query here because i found this post is more relavent to my issue.

                    Do you support application.xml module ordering? If so, please let me know how to do it or where i can find the information on this.

                    Because i'm experience the problem that i need to deploy my war file before to ejb jar deployment.

                    Thanks.

                    -MS


                    • 7. Re: deployment order of ejb modules, how?
                      tylerdurden001

                      Hi,

                      i'm using the JBoss 4.0.4. My deploying order in the application.xml is:
                      a.ejb3
                      b.spring
                      c.ejb3
                      d.war

                      But Jboss allways deployes the .spring archive first. Why ? I thought the application.xml order ist the deployment order.

                      Thank you for your Help.