JMX cannot get OperatingSystem info
I have a server process that I want to monitor in a web page. I would like to display some Operating System information on the web page for my server. I can view the information from my server in jconsole, but I cannot figure out how to get some of the same information in the web page. When I run the code:
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9999/server");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
ObjectName objName = new ObjectName( "java.lang:type=OperatingSystem" );
MBeanServerConnection serverConnection = conn.getMBeanServerConnection();
ObjectInstance instance = serverConnection.getObjectInstance( objName );
I get an exception:
javax.management.InstanceNotFoundException: java.lang:type=OperatingSystem
Where am I going wrong?

