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

Rob Stryker rstryker at redhat.com
Fri Mar 23 02:03:58 EDT 2012


Thanks for the quick response Darran!

I'll be sure to post a bug for you.  For now, I guess my remaining 
question is, is there any way for me to forcefully close these launched 
threads on my own? Is there any cleanup API currently?  If there isn't, 
it's likely JMX support in JBT for as7.1.0.Final will be left out, since 
we can't have threads like this collect endlessly without a cleanup 
mechanism.  So any ability to clean up these threads, even using 
internal classes and non-api workarounds, would definitely help us make 
sure as7.1 has jmx support in jboss tools.

Thanks again for your help.

- Rob Stryker

On 03/22/2012 08:34 PM, Darran Lofthouse wrote:
> The situation you describe for the server not running sounds to be a
> bug, please raise a Jira under the following project with the full
> thread dumps you have and I will arrange for that to be fixed: -
>
> https://issues.jboss.org/browse/REMJMX
>
> Beyond that the port number you have is incorrect, assuming this is
> standalone the connection should be over the management port so port 9999.
>
> Regards,
> Darran Lofthouse.
>
>
> On 03/22/2012 10:27 AM, Rob Stryker wrote:
>> 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
>> _______________________________________________
>> jboss-as7-dev mailing list
>> jboss-as7-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev



More information about the jboss-as7-dev mailing list