1 Reply Latest reply on Jun 27, 2013 9:45 AM by bhavesh bhagat

    Deployment/Undeployment using if-else control flow in JBoss-cli ...

    bhavesh bhagat Newbie

      Hi,

       

      I am trying to undeploy an application, if it is already deployed using following if-else flow:

      [domain@localhost:9999 /] if (outcome == success) of /server-group=DEVGroup/deployment=hello.war/:read-resource

      [domain@localhost:9999 / #] undeploy hello.war

      #1 undeploy hello.war

      [domain@localhost:9999 / #] end-if

       

      The above method does not give any errors/warnings but it does not undeploy the application either.

      [domain@localhost:9999 /] /server-group=DEVGroup/deployment=hello.war/:read-resource

      {

          "outcome" => "success",

          "result" => {

              "enabled" => true,

              "name" => "hello.war",

              "runtime-name" => "hello.war"

          }

      }

      [domain@localhost:9999 /]

       

       

      By the way, I have tried both conditions, (outcome == success) and (result.value == true), without any success.

        • 1. Re: Deployment/Undeployment using if-else control flow in JBoss-cli ...
          bhavesh bhagat Newbie

          Found the solution:

          Tried running the undeploy command without if-else control and got following exception:

          [domain@localhost:9999 /] undeploy hello.war

          Undeploy failed: {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => "JBAS010861: Cannot remove deployment hello.war from the d omain as it is still used by server groups [DEVGroup]"}}

          [domain@localhost:9999 /]

           

          That said, while undeploying application, "--all-relevant-server-groups" MUST be specified. After providing that argument, the control worked as expected.

           

          Thank you!