3 Replies Latest reply on Jun 12, 2007 6:11 AM by alrubinger

    EJB jar deploy order in Jboss AS

    mckeno

      Hi all,

      Is there a way to set the deploying order of each ejb jars in jboss AS.
      say I have these 2 jars: abc.jar and xyz.jar, I want xyz.jar to be deployed and started before abc.jar (somehow Jboss maybe has the alphabetical default deploy order and always deploy abc.jar first).

      So is there way to set the dependency or something like so that we can specify which ejb jar to deploy before another ejb jar?

      Thanks in advance.

        • 1. Re: EJB jar deploy order in Jboss AS
          alrubinger

          Sure. You can do a couple of things.

          If you're looking to alter the order of deployment:

          1) Write your own DeploymentSorter and plug it into the MainDeployer in $JBOSS_HOME/server/[youServerName]/conf/jboss-service.xml - you can customize here to your heart's content.

          - OR -

          2) Add a numeric or alphanumeric prefix (eg "1-myapp.ear") to each of your deployable units, and set the "URLComparator" attribute of the deployment sorter appropriately.

          http://www.jboss.org/wiki/Wiki.jsp?page=URLComparator

          ...but better for you in this case, if your JARs are more than libraries and contain deployable units in themselves (EJB3s, or example), you'd be better off defining in a @Depends annotation the name of the Service upon which your other service depends. Check the JMX Console to get the ObjectNames of your services.

          Check out the Dependency Section here:

          http://trailblazer.demo.jboss.com/EJB3Trail/serviceobjects/jmx/

          Good luck.

          S,
          ALR

          • 2. Re: EJB jar deploy order in Jboss AS
            mckeno

            Thanks for the suggestion.
            Personally I think the option 1 is not practical because it affects every other deployment whereas I just want to change some of the jars deployment order.
            Option 2 is what I am using up to now (that's a bit of "cheating" huh :) ).

            So I think option 3 more dynamic and flexible. Not sure how to do that yet, have to read over example first and again thanks for the link I think that should be what i needed.

            • 3. Re: EJB jar deploy order in Jboss AS
              alrubinger

              No problem; in most cases you're really looking to introduce dependencies at the service level, not based upon order of deployment. Good luck.

              S,
              ALR