[jboss-as7-dev] Questions on connecting to as71 via jmx

Rob Stryker rstryker at redhat.com
Thu Mar 22 06:27:52 EDT 2012


Hey all:

We in JBossTools have a feature for jmx and would like to extend it's 
jmx support to as71, but it seems not to be working in my most simple 
main class example.   I've found links on using jconsole, but no links 
for raw clients.  I do remember that AS3-6 required loading some custom 
classes, and setting a principal and a credential.

So far, I add the following to the classpath of a new plain old java 
project:
   jboss-logging-3.1.0.GA.jar
   jboss-marshalling-1.3.9.GA.jar
   jboss-marshalling-river-1.3.9.GA.jar
   jboss-remoting-3.2.2.GA.jar
   jboss-sasl-1.0.0.Final.jar
   remoting-jmx-1.0.0.Final.jar
   xnio-api-3.0.3.GA.jar
   xnio-nio-3.0.3.GA.jar

Then I write the following main method:
         try {
             String url = "service:jmx:remoting-jmx://localhost:1090";
             Map<String, String[]> environment = new HashMap<String, 
String[]>();
             JMXConnector connector = JMXConnectorFactory.connect(new 
JMXServiceURL(url), environment);
             MBeanServerConnection connection = 
connector.getMBeanServerConnection();
             Set beanInfo = connection.queryNames(new ObjectName("*:*"), 
null); //$NON-NLS-1$
         } catch( Exception e ) {
             e.printStackTrace();
         }


If the server is not running, the result is the program never closes. 
There are three threads, two of which are remoting endpoints, and a 
DestroyJavaVM Thread. Exception is as follows:

java.lang.RuntimeException: Operation failed with status WAITING
     at 
org.jboss.remoting3.jmx.RemotingConnector.connect(RemotingConnector.java:155)
     at 
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
     at MyMain.main(MyMain.java:17)

How do I properly recognize this "RuntimeException"? Is there some 
superclass I can catch, or is this it? Finally, how do I properly clean 
up the connections to ensure those threads disappear?

If the server *is* running, launched via standalone.xml,  the result is 
identical.

Does the default as71 come with JMX enabled and exposed? If not, what 
needs to be done to expose it?

Thanks again

- Rob Stryker


More information about the jboss-as7-dev mailing list