3 Replies Latest reply on Apr 7, 2006 10:19 AM by Kurt De Wit

    deploy .sar after .ear in Jboss

    ft liou Newbie

      I can get Jboss to deploy .sar file (the service bean) when Jboss starts, but the .sar file contains references(import statements etc) to ejbs in another .ear file. So when Jboss deploys the .sar file, the .ear file is not yet deployed, then Jboss doesn't recognize those references, so resulting in error messages.

      My question is: how can I tell jboss to deploy the .sar file AFTER those ejbs (.ear file) are deployed (instead of deploying .sar file in the first instance)?

      Thank you very much!!

        • 1. Re: deploy .sar after .ear in Jboss
          Ian Otahal-Mechura Newbie

          The deploy-hasingleton-service.xml file gives an example of one way to do this:

          <mbean code="org.jboss.ha.singleton.HASingletonController"
           <depends optional-attribute-name="TargetName">jboss.system:service=MainDeployer</depends>
           <attribute name="PartitionName">${jboss.partition.name:DefaultPartition}</attribute>
           <attribute name="TargetStartMethod">deploy</attribute>
           <attribute name="TargetStartMethodArgument">${jboss.server.home.url}/deploy-hasingleton</attribute>
           <attribute name="TargetStopMethod">undeploy</attribute>
           <attribute name="TargetStopMethodArgument">${jboss.server.home.url}/deploy-hasingleton</attribute>

          • 2. Re: deploy .sar after .ear in Jboss
            Ian Otahal-Mechura Newbie

            You would put the above depends statement in you jboss-service.xml file located in the META-INF directory of you .sar file

            Ian :-)

            • 3. Re: deploy .sar after .ear in Jboss
              Kurt De Wit Newbie

              Or use the ordered deployment mechanism provided by JBoss...

              Replace in the jboss.service.xml

              <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter

              <attribute name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter

              This way you can add numbers in front of your archive files to specifiy the deployment order. Non-prefixed packages are deployed first respecting default deployment order, prefixed are deployed next according to the prefix (nnn-name.xAR)