2 Replies Latest reply on Nov 7, 2013 11:42 AM by kotra.michal

    Jboss 7 - undeploy all ears before server startup

    kotra.michal

      Hello,

       

      I have following problem. My application consist of two ear files (ears have dependencies, and the can not be deployed at the same time, like jboss 7 do).

      The deployment order is really important in this case, so I decided to switch off deployment scanner and deploy two ears using cli scrip to deploy it in proper order (ear1 first and then ear2):

       

      #!bin/sh

      sh /home/jboss/jboss/bin/jboss-cli.sh -c "deploy /home/jboss/ear1.ear"

      sh /home/jboss/jboss/bin/jboss-cli.sh -c "deploy /home/jboss/ear2.ear"

       

      and undeploy:

       

      #!/bin/sh

      sh /home/jboss/jboss/bin/jboss-cli.sh -c "undeploy ear2.ear"

      sh /home/jboss/jboss/bin/jboss-cli.sh -c "undeploy ear1.ear"


      Then i modified my /etc/init.d/jboss startup scripts as follows:

       

      start:

      - startup  jboss

      - undeploy ear2 and ear1 using cli scripts (if nothing is deployed this will give me proper message, but works - OK )

      - deploy ear1 and ear2 using cli scripts

       

      stop:

      - undeploy ear2 and ear1

      - shudtown jboss

       

      Everytihing works fine but there is one scenario that causes problem: jboss is not stopped by my startup script (sever crash, reboot, kill jboss PID etc).

       

      In this case my startup script works like that:

       

      - start jboss (there are old <deployments> entires in my standalone.xml config) - here is root of the problem, I don't want to deploy (In standard jboss parralell mode) everything at startup only to undeploy it, and then deploy it in correct order

      - undeploy cli-script - OK

      - deploy cli-script - OK

       

      Is there any way to skip ear deployment at startup, or do I have manually modify my server config xml file (ex. using sed to remove <deployment> entries)

       

      Thanks for any help,

       

      Michał

        • 1. Re: Jboss 7 - undeploy all ears before server startup
          ctomc

          Hey,

           

          since 7.2 there is option to specify deployment dependencies.

          This should resolve your initial problem without any need for extra scripts.

          • 2. Re: Jboss 7 - undeploy all ears before server startup
            kotra.michal

            Hi Tomaz, thank you for your answer.

             

            Could you, please show me part of documentation concerning deployment dependencies in 7.2? 

             

            In my 7.1.1 I have tried to set dependencies in jboss-deployment-structure.xml but it seems not to chenge deployment order. Is this fixed in 7.2 ?

             

            I am after migration of ma app from jbosa 4.2.2 to jboss 7.1.1 and I think the order deployment is my last porblem to solve.

             

            greetings,
            Michał