3 Replies Latest reply on Apr 7, 2006 10:19 AM by jboss2005_01

    deploy .sar after .ear in Jboss

    _monkey_

      Hi...
      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
          ianmechura

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

          <mbean code="org.jboss.ha.singleton.HASingletonController"
           name="jboss.ha:service=HASingletonDeployer">
           <depends>jboss:service=${jboss.partition.name:DefaultPartition}</depends>
           <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>
           </mbean>
          


          • 2. Re: deploy .sar after .ear in Jboss
            ianmechura

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

            HTH,
            Ian :-)

            • 3. Re: deploy .sar after .ear in Jboss
              jboss2005_01

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

              Replace in the jboss.service.xml

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

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


              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)


              Cheers,
              Kurt