Deploy a webapp using twiddle
https://access.redhat.com/kb/docs/DOC-25507 How do I redeploy an application in JBoss using twiddle? Article ID: 25507 - Created on: Mar 9, 2009 2:03 PM - Last Modified: Mar 28, 2011 11:35 AM Issue Sometimes command line access is required to deploy, redeploy, and undeploy applications where the jmx-consol may not be available, or direct access to the machine is not available. In these cases, twiddle is an appropriate tool. You can also use twiddle for cluster deployment. Environment JBoss Enterprise Application Platform (EAP) 4.x 5.x Resolution Using twiddle to access your JBoss instance remotely, you can use the MainDeployer MBean (jboss.system:service=MainDeployer) to deploy, redeploy, and undeploy your applications if they exist at a URL that the JBoss instance can access. To deploy your application where the local twiddle instance is on Unix, use this command line in $JBOSS_HOME/bin: ./twiddle.sh -s invoke "jboss.system:service=MainDeployer" deploy is the host:port of the server to which you want to deploy your application. The string should look like localhost:1099 unless the IP or port has been changed. is the full URL to your application deployment. It can be a file URL (eg file:///apps/jboss-eap/jboss-as/server/default/deploy/test.war/) or a HTTP URL (eg http://host.domain:port/path/to/application/MyApplication.ear). Note: If you are running this command in a Windows environment, you would replace ./twiddle.sh with twiddle.bat. You may also need to supply a username and password to this command using the -u and -p command line arguments. If you fail to supply the username and password when one is required you will see the exception: java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:97) ... To undeploy your application substitute "deploy" with "undeploy" in the command line and to redeploy your application, substitute "redeploy". Cluster Deployment Twiddle can also be used for cluster deployment as long as the application to be deployed is visible to all cluster instances/nodes. If the application is on a shared file system, a file URL could be used, whereas a HTTP URL is likely to be accessible to all cluster members by default. Following the steps outlined above, you can use the twiddle client from any JBoss installation even if it's not a part of the cluster in question. To deploy to a cluster, you would need to run the deploy command mentioned above, once for each member in the cluster. Since only the JNDI URL would change for each twiddle invocation, it is easily scriptable. For example: ./twiddle.sh -s localhost:1099 invoke "jboss.system:service=MainDeployer" redeploy "file:///apps/jboss-eap/jboss-as/server/default/deploy/test.war/" References For further information on twiddle refer to the "Command Line Access to JMX" section of the Enterprise Application Platform Server Configuration Guide documentation, accessible at http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/4.3/html/Server_Configuration_Guide/Command_Line _Access_to_JMX-Sample_twiddle_Command_Usage.html (Note this section is no longer in the EAP5 docs.)