JMX Remoting
The MC4J application now has support for connecting to any server support the JMX Remoting Protocol 1.0+ as defined by JSR-160. This specification aims to provide a common remote connection specification and will hopefully, finally make JMX implementations compatible. At the moment, a few major application servers are supporting jmx remoting, and MC4J can connect over JSR-160 style connections to both them and MX4J 2.x services as well as J2SE 1.5 JVMs.
 | MC4J must execute on JDK 5
In order to use the specialized 5 monitoring and graphing features of MC4J you must run MC4J with the 5 JVM. To do this, you must select a 5 JVM while installing MC4J... if you need to reset which JVM for MC4J to use, it is probably easiest to just reinstall MC4J and select the 5 JVM. |
J2SE 5.0 Management and Monitoring
The J2SE 5.0, released by Sun, has support for JMX Remoting and can be connected to through MC4J's JSR-160 style connector. The Management and Monitoring specification added to the JVM in this release is documented in the Management and Monitoring section of the 5 documentation.
Connecting MC4J to J2SE 5
In order to connection MC4J to a J2SE 5 JVM you must first have the JVM start the JMX MBean Server and the Remoting adaptor. This can be done simply by adding a command line argument to the java command such as: (java -Dcom.sun.management.jmxremote.port=8999). You'll also need to disable the SSL requirement. Either in the jre/lib/management/management.properties file or by supply the system property (-Dcom.sun.management.jmxremote.ssl=false) to your java call. You will also want to customize jvm management properties to add a username and password. You can edit the <jdk-home>/jre/lib/management/jmxremote.password file to add a username and password combination.
 | SSL not supported
The current version of MC4J does not yet support SSL connectivity to JDK 5 and so this must be turned off in either the management.properties file or with system properties. |
Passing the port number to connect to will have the JVM start the facilities in the JVM to allow MC4J to connect to it. To connect MC4J to this JVM, follow these steps:
Choose the Management -> Create Server Connection menu item
Select the JSR 160 connection type from the first drop-down
Enter a name for the connection
Customize the hostname, port and path in the Server URL. Make sure the port is the same as specified on the command line above. Set the path to be jmxrmi. The final Server URL in the case of a local jvm would be: service:jmx:rmi:///jndi/rmi://localhost:8999/jmxrmi.
Enter the username and password you specified above
Complete the wizard with no other customizations
This should connect you to your J2SE JVM and show you about 17 built in MBeans. The global dashboards section will have the dashboards to show you the cool thread info and memory pool graphs and charts.
Requirements
This will only work with J2SE 5 final release available at Sun's download section.
Note you need at least 4 comamands not two for JMX to work under JDK 5!
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=%my.jmx.port%
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
if authenticate is true you need to add two lines to indicate where the jmxremote.passwrd and jmxremote.acces files are stored..
Tomcat 5.5 part has the exact same mistake.. you need at least 4 lines above to make it work..