Chapter 5. JMX Resources

JMX Resources

Command-line and standalone HTML-over-HTTP Adaptors.

http://admc.com/dist/admcjmx-adaptors.jar. Source code at http://admc.com/dist/admcjmx-adaptors-src.zip.

First set your CLASSPATH to include the http://admc.com/dist/admcjmx-adaptors.jar file and the classes which you want to manage. Then run the console or http/html adaptor as follows.

    java com.admc.jmx.JmxStreamAdaptor
            

or

    java com.admc.jmx.JmxHtmlAdaptor -h
            

(You can, of course, also embed these classes into other apps). The JmxHtmlAdaptor command above will show you the simple syntax to specify port number and security options. To run with TLS encryption, you need to set up keystores, passwords, etc., according to the JSSE Guide that ships with Sun's JDK. See the Instrumentation chapter of this document for screen shots of both the command line and Http adaptors. The source distro also includes a sample policy file and startup script so that you can securely give unknown users access to a limited set of MBeans.

My JMX Management Web Application (war)}

http://admc.com/dist/jmxhtml.war. Source code at http://admc.com/dist/jmxhtml-src.zip.

Just like the html-over-http adaptors of the previous item, except this runs in a servlet container instead of starting up its own HTTP server. (This war actually includes the http://admc.com/dist/admcjmx-adaptors.jar of the previous item). The war uses a client JMXConnector to connect to a JMXConnectorServer. If you don't have your own JmxConnectorServer running, edit and compile the one included in the source zip file. To run with a security manager, edit the included startup script.

Demo Standalone JMX Manager/Adaptor

http://admc.com:8111/

You can manage instances of the sample MBeans used in this HOWTO (other than the ones named Trivial*). This is a live instance of my Html-over-Http Adaptor.

Demo JMX Manager/Adaptor Web App at

http://admc.com:8080/jmxhtml/jmx

You can manage instances of the sample MBeans used in this HOWTO (other than the ones named Trivial*). This is a live instance of my Web App Adaptor running on Tomcat 5.

MX4J Open Source JMX

http://mx4j.sourceforge.net/

Really good. I document use of MX4J's AbstractDynamicMBean, and HttpAdaptor with XSLTProcessor. Personally, I wouldn't do a job involving considerable Dynamic MBean usage if I couldnt' use AbstractDynamicMBean. Since Java 1.5 now comes with a basic JMX implementation, the MX4J core JMX implementation is really redundant and just adds ambiguity (viz, whose JMX classes are the factories returning?). Fortunately, the AbstractDynamicMBean and adaptor classes are very easy to separate from the rest of the mx4j distribution. My adaptors bundle the two mx4j classes needed for AbstractDynamicMBeans, and I recommend this practice.

JMX 1.2.1 RI

http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=7657-jmx-1.2.1-oth-JPR&SiteId=JSC&TransactionId=noreg

Sun's latest cut of JMX. I haven't looked into the difference between this distribution and what is included in the 1.5 JDK. I do know that this RI includes samples of dynamic MBeans, whereas the JDK doesn't even describe dynamic MBeans.

JMX 1.2 Spec

http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=7127-jmx-1.2-mr-spec-oth-JSpec&SiteId=JCP&TransactionId=noreg

Specification 1.2 for the Instrumentation and Agent levels.

JMX Remote API 1.0 Spec

http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=jmx_remote-1.0-fr-oth-JSpec&SiteId=JCP&TransactionId=noreg

Specification 1.0 for the Distributed Services level of JMX. (aka JMX Remote API).

JMX Remote API RI 1.0.1

http://java.sun.com/products/JavaManagement/download.html

Sun's latest cut of the JMX Remote API (the Distributed Services level).

JBoss download site

http://www.jboss.org/index.html?module=html&op=userdisplay&id=downloads

JBoss has a JMX implementation. I'm not working with it because

  1. For the past year or two JBoss is concentrating on generating revenue by providing services, not products. They don't even have a Products item on their main web site menu. On their download page, for the current version of JBoss, you can only download one zip file of everything, or one other component (which is not JMX). I'd much rather go to MX4J on Sourceforge, or to Sun's JMX site and download just what I want.

  2. When I last downloaded another component product from JBoss (JBossJMS), the only high-level or howto documentation available was a PDF document that I paid for. While the document was ok, it was extremely inconvenient to have to keep going back to a PDF document without any bookmarking or hypertext capabilities. Before that, I had the same exact experience with the full JBoss distribution.

If JBoss now has modern documentation and makes their JMX product easily accessible, email me at blaine.simpson@admc.com and I will update this document.

Thanks to Monal Daxini for contributing the following update about JBoss:

The following is the link http://sourceforge.net/project/showfiles.php?group_id=22866 where you can download the JBoss JMX implementation. This link was provided at the end of the page with URL: http://www.jboss.org/index.html?module=html&op=userdisplay&id=downloads. The current release is not JMX 1.2 ready, and has very poor docs as you mentioned.

FYI: I have the Connectors working fine with java 1.3 but had to jump a couple of hoops before I could get it right. Specifically, had to add jaas.jar in the CLASSPATH in order for the examples with Sun JMX RI to execute. However, jaas.jar is not required to compile the examples. If I find any more quirks will let you know. jaas.jar was downloaded separately from sun's website.