3 Replies Latest reply on Mar 10, 2004 12:18 AM by Todd Hough

    Order of ear loading

    Mark Newbie

      I have an EJB that uses classes from other EJBs from another application. In my jboss.xml I have the following to make this work:

      <enterprise-beans>

      <ejb-name>VolatilityManager</ejb-name>
      <jndi-name>saen/VolatilityManager</jndi-name>
      <ejb-local-ref>
      <ejb-link>UnderlyingManager</ejb-link>
      </ejb-local-ref>
      <ejb-local-ref>
      <ejb-link>DividendManager</ejb-link>
      </ejb-local-ref>


      </enterprise-beans>


      Unfortunately this only works sometimes. Occasionally on startup JBoss loads the ear containing the VolatilityManager before loading the ear containing the other EJBs, causing a deployment failure. Is there a way to configure the order in which I want the ears to be deployed on startup?

      Somehow I had thought JBoss should be able to figure out the dependencies from the jboss.xml files by itself, but apparently it doesn't. So far I haven't found anywhere how I can influence the load-order of ears, so any help would be appreciated.

      Mark

        • 1. Re: Order of ear loading
          Darran Lofthouse Master

          Have a look for PrefixDeploymentSorter

          • 2. Re: Order of ear loading
            Mark Newbie

            I did see the "PrefixDeploymentSorter" solution, however I had hoped there was a better solution to it. This seems a rather temporary solution to something fundamental.

            I probably won't have time to implement it myself, but a deployment sorter that looks in the ear for ejb-ref links would be ideal and not tht hard to make. Even a DeploymentSorter that takes a fixed xml-file to base it's ordering on would be better than this prefix-sorter.

            • 3. Re: Order of ear loading
              Todd Hough Newbie

              Make a new directory under your deploy directory named "deploy.last" and put the VolatilityManager EAR in there.

              Or, I think as of 3.2.3 you can specify a tag in your application.xml that will let JBoss know to deploy one before the other and redeploy both if the one changes. I ran into a bug with this though that prevented hot redeploy from working. Its supposed to be fixed in 3.2.4 that's rumored to be out soon.