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(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
--
Darran Lofthouse - Principal Software Engineer
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parson
(USA), Charlie Peters (USA)