JBoss - Examples of twiddle

The twiddle utility that ships with JBoss is quite powerful. However, one has to struggle to find examples of how to use it.

After trying a bunch of things, here are examples of some of the command that were quite useful for me:

Deploy a WAR/EAR

twiddle.sh -s localhost invoke "jboss.system:service=MainDeployer" deploy "file:///Users/indy/Desktop/railo-jboss1.local"

Undeploy a WAR/EAR

twiddle.sh -s localhost invoke "jboss.system:service=MainDeployer" undeploy "file:///Users/indy/Desktop/railo-jboss1.local"

Add an Alias for a Web Context

twiddle.sh -s localhost:1499 invoke "jboss.web:host=a1,type=Host" addAlias railo-jboss1.local

Find Aliases for a Web Context

twiddle.sh -s localhost:1499 invoke "jboss.web:host=a1,type=Host" findAliases

I also saw the following three resources and found them quite useful:

Comments

Manoj

Manoj wrote on 06/08/09 10:02 PM

Good article thanks. But i was looking at another example of accessing the http connector bean/ajp connector bean from twiddle ? Do you have any idea how to invoke that ?
Indy Nagpal

Indy Nagpal wrote on 06/09/09 9:45 AM

Manoj, have you checked if you can do something like that from the jmx-console? Normally twiddle commands can be quite easily recreated based on the path you take in jmx-console to do a task.
Rajkumar Patel

Rajkumar Patel wrote on 03/04/10 2:13 AM

Hi,
Tried to deploy EAR file using the above method and it prints "NULL" as output. I did check the JBoss logfile, and could see just one liner and no activity:


Command used:
./twiddle.sh -s ko-sled10 invoke "jboss.system:service=MainDeployer" deploy "file:///home/rpatel/riskwrite.ear"

In log file:
2010-03-03 12:58:09,578 INFO [org.jboss.deployment.MainDeployer] (RMI TCP Connection(528)-192.168.216.39) deploy, url=file:/home/rpatel/riskwrite.ear

Can you help me please?

regards
Raj

Leave a comment

Tell us about yourself
(required field)
(required field)
Comment and preferences
Leave this field empty: