I'm trying to retrieve jboss MBean values without using Twiddle. I'm using JMX remotely as I have with WebLogic, Tomcat, etc. I get some domains, but it's a different set than Twiddle is returning.
Why are jboss.system, jboss.jca, etc.domains missing when I connect to my JMX port? What do I need to include to get these?
My code is just establishing a connection to our JMX port on localhost and requesting domians like so:
| urlStr = "/jndi/rmi://" + _host + ":" + _port + "/jmxrmi"; | _ | |
| _url = new JMXServiceURL ("rmi", "", 0, _urlStr); | ||
| Map<String, String[]> env = new HashMap<String, String[]>(); | ||
| env.put (JMXConnector.CREDENTIALS, new String[] {_user, _pswd}); | ||
| _conctr = new RMIConnector (_url, env); | ||
| _conctr.connect (); | ||
| _contn = _conctr.getMBeanServerConnection(); |
and
| for (String str : _contn.getDomains()) { |
Twiddle gives:
| com.arjuna.ats.properties |
| jboss |
| jboss.admin |
| jboss.alerts |
...
| jboss.web |
| jboss.web.deployment |
| jboss.ws |
| JMImplementation |
JMX returns:
| com.sun.management |
| java.lang |
| java.nio |
| java.util.logging |
| jboss.ws |
| JMImplementation |
| rhq.pc |
Oh, I neglected to mention that this is for JBoss 5.1, though I don't know if that matters.