Buttso Does the BLOG Thing :

 

Subscribe to "Buttso Does the BLOG Thing" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Running OC4J with MX4J

Running OC4J with MX4J

The OC4J 10g (10.0.3) Developer Preview we have on OTN supports JMX 1.2.  We ship the product with it's own embedded JMX server implementation. 

In addition to the Sun reference implementation, there also exists a very popular open source implementation of JMX called MX4J (see the MX4J website at http://mx4j.sourceforge.net/).

We can use the MX4J implementation (both 1.1.1 and 2.0 B1) with OC4J by replacing the embedded JMX server libraries we ship. 

Here's how to do it:

MX4J 1.1.1

  1. Stop OC4j if it is already running
  2. Download the MX4J 1.1.1 distribution from Sourceforge -- http://prdownloads.sourceforge.net/mx4j/mx4j-1.1.1.zip?download
  3. Unzip the downloaded file
  4. Copy the MX4J runtime (lib/mx4j-jmx.jar) from the MX4J distribition into the OC4J lib directory (j2ee/home/lib)
  5. Rename the existing JMX implementation (jmxri.jar) so it isn't loaded by OC4J
  6. Restart OC4J.


OC4J should now be running with the MX4J JMX 1.1.1 implementation.

You can verify this by using the OC4J JMX Console.  Open up the console and click on the MBeanServerDelegate MBean




This will let you view the attributes of the MBean, of which the ImplementationVendor setting shows:

ImplementationVendor

Description : Attribute exposed for management
MBean : JMImplementation:type=MBeanServerDelegate
Type : java.lang.String
Access : Read Only
Value:
MX4J

MX4J 2.0 Beta1

The MX4J folks have recently released a beta version of MX4J 2.0.  This too can be used with OC4J.  We need to do small rename of one of the MX4J libs so it works with OC4J, see step 4.
  1. Stop OC4J if it is already running
  2. Download the MX4J 2.0 B1distribution from Sourceforge -- http://prdownloads.sourceforge.net/mx4j/mx4j-2.0-beta-1.zip?download
  3. Unzip the downloaded file
  4. OC4J is pre-configured to load the mx4j-jmx.jar file if it finds it in it's library path. The MX4J folks have re-partitioned their distribution into a different set of JAR files. The easiest way to get it to work is to copy the lib/mx4j.jar from the MC4J distribution into the OC4J lib directory ((j2ee/home/lib) as mx4j-jmx.jar .  You could modify the  Class-Path element of the Manifest.mf file inside of oc4j.jar, but I'd don't want to encourage you to mess with our JAR files
  5. Rename the existing JMX implementation (jmxri.jar) so it isn't loaded by OC4J
  6. Restart OC4J.

OC4J should now be running with the MX4J JMX 2.0 B1 implementation.

Using the JMX Console, you should now see the implementation vendor listed as MX4J, and the implementation version as "2.0-beta-1".

ImplementationVersion

Description : Attribute exposed for management
MBean : JMImplementation:type=MBeanServerDelegate
Type : java.lang.String
Access : Read Only
Value:
2.0-beta-1

And that's all there is to it!








© Copyright 2004 buttso.
Last update: 2/16/2004; 11:17:25 AM.

Click here to visit the Radio UserLand website.