3 Replies Latest reply on Aug 13, 2014 4:01 AM by Jay SenSharma

    Enable/Disable war components throough CLI

    Jukka Nylund Newbie


      I'm part of a project developing a application running on multiple jboss instances. War files distributed to several servers.

      As a part of a fallback procedure all wars will de deployed on all servers but some disabled. If a server goes down

      we need to start up the disabled components on another server.


      My question. What would be the most effective way of doing this? It must be possible to trigger this automatically as

      a server goes down.



        • 1. Re: Enable/Disable war components throough CLI
          Jay SenSharma Master



             If you are using deployment scanner based deployment then you can try using the deployment marker file ".skipdeploy", The ".skipdeploy" marker file disables auto-deploy of an application while present. Useful as a method of temporarily blocking the auto-deployment of exploded content, preventing the risk of incomplete content edits pushing live. Can be used with zipped content, although the scanner detects in-progress changes to zipped content and waits until completion.


            At later point of time if you would like to deploy those application then juse rename the ".skipdeploy" files to ".dodeploy" file.


          [1] https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Administration_and_Configurat…

          • 2. Re: Enable/Disable war components throough CLI
            Jukka Nylund Newbie

            Thanks, but we are using the JBoss 6.2 EAP CLI for deploying wars.


            We deploy using "deploy <war file> --disabled" to deploy which requires that the war file is not already deployed. As the --force option does not work together with --disabled.


            To enable the war we use "deploy --name=<war file>" which enables the war.


            To be able to disable the component again we have to first undeploy the war and redeploy it again with the --disabled option.


            This takes time and I wonder if there is a faster way of doing this using the CLI.

            • 3. Re: Enable/Disable war components throough CLI
              Jay SenSharma Master


              Unfortunately via CLI i do not see any other better option to achieve your goal. Following is the best way to enable and to deploy an application in disabled  mode.


              Deploy in Disabled mode

              deploy /PATH/TO/TestWebApp.war --disabled


              Enable/Start an application which is already deployed (and is in STOPPED state)

              deploy --name=TestWebApp.war


              The time taken by the application components to start should be almost same as when you try to deploy an application normally.  This is because when you deploy an application in  "disabled" mode that time only the content of the application is uploaded in the JBoss content repository, But the application is not actually started.   The application startup time should be same. 


              Total Deploy Time  = (time taken to upload the content in the repository) + (Time taken by the components/services of the application to be started)


              If it is taking abnormally longer time to start the application then it should be investigated by looking at couple of thread dumps.