JMX + Tomcat 5.0.25 + j2sdk1.4.2

Uncategorized Add comments

Hereunder is workaround to make Tomcat 5.0.25 JSR 160 compatible

JSR 160 provides a standard way to connect to remote JMX-enabled applications using RMI; it is possible to use JMX JSR 160 implementation on client side, and have a JMX Remote Reference Implementation on server side, or vice versa. This allows the creation of Management Consoles based on Swing, for example that will be able to interoperate no matter which JMX implementation is used.

To make a system (or system component) accessible for monitoring via JMX-enabled monitoring applications this system has to be JSR 160 compatible.
It can be achieved by running this system component on JDK1.5, or using third party implementation such as MX4J

The problem is:
AdvenNet’s “Applications Manager 6″ is only able to interact with the Remote JMX JSR 160 RMI compatible Adaptors. Tomcat 5.0 does not have it neither it has its own implementation of the adaptor nor JDK provides one (we are running on JDK 1.4)

While it is possible to eliminate this problem by moving application to Tomcat 5.5 and JDK 1.5, it is not always feasible.

Solutions:
1) Tomcat 5.0 contains old (as it seems now) version of MX4J library. You have to fool Tomcat 5.0 and load new MX4J library classes instead. Unfortunately placing new jars into various folders will be no good as the old library will be already loaded by bootstrap classloader.
It also seems that Tomcat code contains some logic to check whether /bin/jmx.jar is in place.
But you can change the jmx.jar library content.
I took latest MX4J 3.0.1 and repacked compiled code from jars into one.
That is it.
Now while still running Tomcat 5.0 your web application can register MBeans and expose them through MX4J implementation of RMI Adapter for external management.

Share

Comments are closed.

Entries RSS Comments RSS Log in Admin