Create an RMI server using code like the following: MBeanServer server = ManagementFactory.getPlatformMBeanServer(); LocateRegistry.createRegistry(9589); JMXServiceURL addr = new JMXServiceURL("rmi", null, 0, "/jndi/rmi://localhost:9589/jmx"); RMIConnectorServer cs = new RMIConnectorServer(addr, env); ObjectName name = new ObjectName("connector:type=cserver,name=mycserver"); server.registerMBean(cs, name); cs.start(); Then run jconsole using a URL like this: jconsole service:jmx:rmi://localhost/jndi/rmi://localhost:9589/jmx The MBean Server you see is not the one created above. This is a regression, because JConsole from JDK 5.0 does the right thing. The bug is in JConsole, because if you create a connection programmatically using the same URL it works correctly. This problem was reported on the SDN JMX forum by Robin Merckx and Erik Vaneylen; see <http://forum.java.sun.com/thread.jspa?messageID=9569129>.
|