5 Replies Latest reply on Nov 26, 2008 4:19 PM by Benoit Xhenseval

    .ear priority deployment

    Matt Fury Newbie

      Google is failing me so I am coming straight to the source. We have an app that we are deploying that depends on other apps to be loaded first but I noticed JBoss is loading them in alphabetical order. Is there a way to prioritize the loading of the .ear applications. I know that you can set the priority in Weblogic. I can't find a way to do it in JBoss. I found you can set the priority of application types like .war, .ear, etc. but not within the extension themselves.

      Sorry if it's right in front of my face!

      Thanks.

      -Matt

        • 1. Re: .ear priority deployment
          V B Newbie

          Hi,
          I have 2 solutions for you :
          - you can easily extend the JBoss DeploymentSorter. Then declare the new class in jboss-service.xml in URLComparator.
          - you can define dependencies between jmx names. You can say for example that the war needs an ejb or an ear or a sar. There is only one limitation : you can't define a dependency deployement for an ear. But you can set a jmx-name so that others can depends on this ear.
          Example : in you war's jboss-web.xml, you can set
          <jboss-web>
          myservice:service=OwnService
          </jboss-web>
          In this case, you war won't deploy until OwnService is deployed.

          Vincent

          • 2. Re: .ear priority deployment
            zhengxi qu Newbie

            hi vberetti
            I need to solve this problem also.
            and i want to use your second solutions.

            I add this to jboss-web.xml, but it doesn't work. could you please describe it in details. thanks a lot.
            <jboss-web>
            myservice:service=OwnService
            </jboss-web>

            • 3. Re: .ear priority deployment
              V B Newbie

              Hi,
              In your ear, in META_INF/jboss-app.xml :

              <jboss-app>
               <jmx-name>myservice:service=OwnService</jmx-name>
              </jboss-app>
              

              In your war, in META-INF/jboss-web.xml:
              <jboss-web>
               <depends>myservice:service=OwnService</depends>
              </jboss-web>
              

              this way, your war will deploy after your ear is deployed. But keep in mind that the ear depends on the war is not possible. The deployment of the ear can not depend on other services (but services in the ear can).
              Hope it will help you.
              Vincent

              • 4. Re: .ear priority deployment
                zhengxi qu Newbie

                thank you very very much:)
                it works fine.

                could i get your IM account or email?
                my email: quzgxi@gmail.com

                if you don't like that, just skip my request :)

                thanks again.

                • 5. Re: .ear priority deployment
                  Benoit Xhenseval Newbie

                  Hi All,

                  I have a similar problem, I'm trying to get a Quartz MBean setup and get it to deploy AFTER my ear application (the Jobs classes are included in my ear file).

                  How could I do this?

                  Using this dependency does not work

                  <depends>jboss.j2ee:service=EARDeployer</depends>


                  As it seems to be completed before the app is actually deployed.

                  I even tried 3 dependencies:
                  <depends>jboss.ejb:service=EJBDeployer</depends>
                  <depends>jboss.jca:service=DataSourceBinding,name=QuartzDS</depends>
                  <depends>jboss.j2ee:service=EARDeployer</depends>


                  But same problem, it looks like Quartz is launched before the ear is fully deployed...

                  Any pointer/solution would be greatly appreciated.

                  Thanks

                  Benoit