Are there any simple ways to see what wars have been deployed in Jboss AS and undeploy some of them? I want to do this from the command line.
I tried using jmx but I keep getting exception saying “org.jboss.util.NestedRuntimeException: jmx not bound;” I’d prefer to do it in a way where I don’t have to stop and start the application server.
You can approach this in three ways in JBoss Application Server 7:
Management Console
Being a GUI, the Management Console is the most visual of the three, and you can see the list of deployed applications under the Deployment window. You have the option to Disable and Remove the deployed applications listed here. This screenshot is from AS7.0.2, and some windows have and will change with the addition of tabs, but the general functionality remains the same.
Management CLI
The Management Command Line Interface is a new addition to AS7. The CLI exposes a lot of low-level functionality, and is a powerful tool once you get familiar with the commands and operations. As you might expect, you can run
helpto show the commands, or run<commandname> --helpfor more information on a specific command. Two useful commands aredeployandundeploy, so let’s look at their help information. I’ll give Linux examples, but you can insert your flavour of OS as required.Here’s
deploy:And here’s
undeploy:The CLI In Action
Running the
deployorundeploycommand without any arguments will list all the applications available. So your workflow to log in to the CLI and undeploy an application would be like this (simplified):Change directory from EAP_HOME to the bin folder:
Run the CLI logon script:
Instruct the API to connect (this can also be passed at runtime as
./jboss-admin.sh --connect).Run the undeploy command to display available applications.
Run the undeploy command to undeploy the application. In this case, the test.ear.
Deployment Folder
If you are running an instance of AS7 as a development tool, and are using the deployment folder, you can simply delete the application. You will notice that a marker file is created, such as
test.ear.failed, to signify the status of the application deployment.