3 Replies Latest reply on Jun 15, 2004 9:26 AM by jae77

    how can i make an EJB be deployed first

    plantule

      I use jboss-3.0.7_jakarta-tomcat-4.1.24 .
      In my project I have an EJB in an EAR called uniportal.ear .
      Also I have many servlets in many WARs . In some servlets' Init method ,we need call EJB's method . How can i make the EJB be inited before all WARs deployed ?

        • 1. Re: how can i make an EJB be deployed first
          gudmundsonsc

          Write your own DeploymentSorter.

          • 2. Re: how can i make an EJB be deployed first
            bwallis42

             

            "gudmundsonsc" wrote:
            Write your own DeploymentSorter.


            You certainly can do this. Having done it I can't say I recommend it. The way we went was to maintain a global deployment ordering list and sort based on that. It is a pain in the ass to maintain this.

            Using the PrefixDeploymentSorter is another option, you just have to name your deployed files 01xxx.ear,02yyy.war, etc.. Of course this is really just the same as above.

            What I think would be real nice is to be able to define dependencies in the deployment descriptors contained in the war/ear/jar files (or somewhere like that) so that the deployment ordering is flexible and a component only has to specify it's own requirements and you don't need a global ordering defined (as in the above two solutions).

            • 3. Re: how can i make an EJB be deployed first
              jae77

              couldn't you specify the ejb dependency in the jboss-web.xml contained in the war using the depends tag?