Sometimes you need to control JBoss status from outside of JBoss's JVM or just talk with JBoss using JMX.
Good example: starting JBoss from Installation programm and waiting upon it will started.
Problem is that you must have jbossall-client.jar in your classpath but you have not.
In JBoss 5 jbossall-client.jar has only references to other 20 jars via MANIFEST.MF
Solution is load jbossall-client.jar dynamically and obtain MBeanServerConnection using Reflection.
Pay attention, in order to create InitialContext you must to switch ContextClassLoader to your ClassLoader.
<code>
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
URLClassLoader cl = new URLClassLoader(new URL[] {new File("JBOSS_HOME/client/jbossall-client.jar")});