4 Replies Latest reply on Mar 17, 2003 12:10 PM by barrycaceres

    Deployment order of ejb's

      I have two ejb modules that share the same code, the only differences being the jndi names and data source settings in the deployment descriptor.

      One jar file, I've called it hss-cris3beans.jar contains all my classes plus the deployment descriptors.

      The other jar file - hss-cris3beans-training.jar just contains the deployment descriptors.

      hss-cris3beans-training.jar will always attempt to deploy before hss-cris3beans.jar and of course it fails because the classes are not yet available.

      If I place a dependency in the jboss.xml they still deploy in the wrong order, surely even if I am getting the dependency wrong this jar should just not deploy at all?

      What is the correct way to ensure services deploy in the correct order?

      I'm using 3.0.4

      Thanks

      Alan Shields

        • 1. Re: Deployment order of ejb's
          srivatsanp

          Hi,
          One workaround.

          Place your classes and deployment descriptors in hss-cris3beans-training.jar

          Let hss-cris3beans.jar contain only deployment descriptors.

          • 2. Re: Deployment order of ejb's

            Yes I'd considered this (or at least renaming the two jars).

            I had a play with the URLComparator, tried PrefixDeploymentSorter and even had a go at writing my own sorter but none of this appeared to work as expected (then I came across another thread that suggested that this was broken).

            I was sort of hoping their would be a 'recommended' method rather than renaming files and hoping for the best.

            • 3. Re: Deployment order of ejb's
              ertdredge

              I'm finding a related problem trying to use the Petstore example application. The modules seem to deploy in a random order, and the order seems to be significant:

              INFO [MainDeployer] Starting deployment of package: file:/Applications/jboss-3.0.4/server/default/deploy/petstore.ear
              [...]
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheInventory
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheProfileMgr
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheSignOn
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheMailer
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheOrder
              INFO [EjbModule] Deploying TheAccount
              INFO [EjbModule] Deploying TheCustomer
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheShoppingClientController
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheCart
              INFO [EjbModule] Deploying TheCatalog
              [...]
              INFO [MainDeployer] Deployed package: file:/Applications/jboss-3.0.4/server/default/deploy/petstore.ear

              % touch petstore.ear

              [...]
              INFO [MainDeployer] Starting deployment of package: file:/Applications/jboss-3.0.4/server/default/deploy/petstore.ear
              [...]
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheCart
              INFO [EjbModule] Deploying TheCatalog
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheInventory
              INFO [EjbModule] Created
              INFO [EjbModule] Creating
              INFO [EjbModule] Deploying TheShoppingClientController
              INFO [EjbModule] Created
              INFO [EJBDeployer]
              Bean : TheCustomer
              Method : public abstract Customer create() throws RemoteException, CreateException
              Section: 7.10.6
              Warning: The return type for a create(...) method must be the session bean's remote interface type.

              [...]


              I can't figure out what the error is coming from, since the return type for the create() in question *is* returning the correct type, but the specific issue seems to be that I need to specify a deployment order.

              - Ert

              • 4. Re: Deployment order of ejb's
                barrycaceres

                Is it feasible in your scenario to compine the deployment descriptors into a single ejb-jar.xml and make it all
                one JAR file.

                We have to support both Weblogic and JBoss, and because
                of some Weblogic inefficiencies with deploying many
                EJB's that may or may not be interdependent we found it
                was faster and easier just to make out ANT script
                combine the ejb-jar.xml's into one that contained
                multiple deployments and place all of the class file
                in the JAR file with the merged ejb-jar.xml.

                If this doesn't work, trying using the "manifest class path" to cause the EJB jar that only contains the
                deployment descriptors to refer to the other's JAR file
                for deployment.

                Let me know if this helps.