Jboss7 command line tool for the Application Server
Author: chszs, reprinted with note. Blog homepage: http://blog.csdn.net/chszs
This article describes how to connect to the server through the JBoss as command line interface. Beginning with jbossas7, a new tool named CLI is introduced, which is located in the % jboss_home % \ bin directory.
Go to the % jboss_home % \ bin directory to check whether the jboss-cli.bat script file exists. Run the JBoss server before executing this script.
Start the JBoss Application Server:
> %JBOSS_HOME%\bin\standalone.bat
Run the CLI script as follows:
> %JBOSS_HOME%\bin\jboss-cli.batYou are disconnected at the moment. Type ‘connect’ to connect to the server or ‘help’ for the list of supported commands.[disconnected /]
Note:: This tool is not included in both the jboss-as-7.0.2.Final and jboss-as-web-7.0.2.Final versions upon inspection. Download the latest jbossas 7.1.1 and include this tool.
As you can see in shell, the session starts. Now we need to connect to the running JBoss instance. The command is as follows:
[disconnected /] connect 127.0.0.1:9999[standalone@127.0.0.1:9999 /]
As you can see, the CLI tool has been connected to a JBoss instance running independently at 127.0.0.1: 9999.
Now, we can use the JBoss CLI tool to stop the JBoss server. The command is:
[standalone@127.0.0.1:9999 /] :shutdown
On-screen output:
{“outcome” => “success”}
Now, run the following command to restart the server using the JBoss CLI tool:
[standalone@127.0.0.1:9999 /] :reload{"outcome" => "success"}[standalone@127.0.0.1:9999 /]
Many other functions need to be explored.