3 Replies Latest reply on Mar 9, 2005 4:08 AM by darranl

    Deployment Order within EAR files

    dirk.koehler

      Hi everybody,

      I just wonder whether there are other options in JBoss4 of how to specify the deployment order of jars, wars and so on than the one of prefixing the archives?

      (other options than the usage of PrefixDeploymentSorter in the jboss-service.xml!!!)

      I have an enterprise archive (ear) in which certain modules are depended on others so there must be a certain deployment order. it seems the server does not keep the order of the modules respective the application.xml...

      prefixing each of the archives in the ear file seems to be quite troublesome...are there other ways to do?

      Many thanks,

      Dirk

        • 1. Re: Deployment Order within EAR files

          What do you have in your EAR file and what order do you want them deployed in? The normal deployment order makes sense 99% of the time. (SAR, EJB-JAR, WAR, etc...) To override this, you already know about prefixdeployment sorter. This is a great option, so I'm not sure why it isn't meeting your needs. Another option is to make use of the "russian doll" packaging. By nesting one application component inside of the other, you can easily create deployment order dependencies.

          There are other ways, but it's hard to make a recommendation without knowing more about what kind of ordering you are trying to achieve.

          • 2. Re: Deployment Order within EAR files
            dirk.koehler

            Thanks for the reply.

            i'm currently involved in migrating an enterprise application from weblogic to jboss whereby it is necessary to ensure that certain ejb modules are deployed before others.

            The problem is to make sure that after a server startup jms messages which were not delivered yet (due to a server shutdown) could be processed by MDB's before other ressources (modules) needed for processing are available. this could cause problems which would be avoided with a right deployment order declaration.

            with weblogic it was possible to specify the deployment order of the modules in a config.xml whereby a prefixing was not necessary. (this is why i asked whether there is a more convenient way to organize the order) now we have to rename our archives after the entire build process before packing everything together in the ear file to ensure the order. as a workaround i wrote an own ant task which solves the problem but a configuration file way would be less troublesome and not that much expensive.

            • 3. Re: Deployment Order within EAR files
              darranl

              Within the jboss specific deployment descriptors there is a 'depends' tag that you can set.

              As each deployable item is deployed one or more MBeans are registered with the MBean server, the depends tags can be used to specify which items must be deployed before the current item is deployed.

              So far I have only used the tags for making services depend on other deployable items, however in theory you can make anything depend on anything.

              If you have a look at the jboss dtds to see where the tags and post an example of what you want to depend on what it will be easier to explain how you can use the tags.