disabling deployed app on Jboss EAP 6

Generally, I don’t write a blog post about something so simple as a 1 off, but seeing as others before me haven’t figured this out and I had only stumbled upon how it works after the fact of some unfruitful researching.

If you have an application deployed on EAP 6 and want to disable it from the CLI tool, look no further. It is very easy and counter intuitive, but it works and you can verify by looking at the management console, which is what I used to disable before I found out how to do it on the command line.

Deploy application

$ JBOSS_HOME/bin/jboss-cli.sh -c --command="deploy snapshot-test.war"

Verify


$ JBOSS_HOME/bin/jboss-cli.sh -c --command="deploy -l"

NAME              RUNTIME-NAME      ENABLED STATUS
snapshot-test.war snapshot-test.war true    OK

Disable application


$ JBOSS_HOME/bin/jboss-cli.sh -c --command="/deployment=snapshot-test.war:undeploy()"

Verify


$ JBOSS_HOME/bin/jboss-cli.sh -c --command="deploy -l"

NAME              RUNTIME-NAME      ENABLED STATUS
snapshot-test.war snapshot-test.war false   STOPPED

Conclusion

Why confusion, well the name for one. I guess it makes sense wrt the container, however, if you run


$ JBOSS_HOME/bin/jboss-cli.sh -c --command="undeploy snapshot-test.war"

The war content will be completed removed from the server, vice running undeploy from the /deployment=<name>:undeploy() operation, where it will just be disabled and not removed from the server.

Advertisements

Author: jasonmarley

I have been with Red Hat since 2010 and love it! My day to day is consulting on RHEL/JBoss/OpenShift, but I work on open source projects in my free time. The best part about my job are my awesome colleagues and our community.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s