http://server-demo-ec2.cloveretl.com/clover/docs/jmx-configuration.html


JMX configuration



Application's JMX MBeans aren't accessible outside of JVM by default. It needs some changes in application server configuration to make them accessible.

This section describes how to configure JMX Connector for development and testing. Thus authentication may be disabled. For production deployment authentication should be enabled. Please refer further documentation to see how to achieve this. i.e. http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#auth

Configurations and possible problems:




How to configure JMX on Apache Tomcat

Tomcat's JVM must be executed with these self-explanatory parameters:


1. -Dcom.sun.management.jmxremote=true
2. -Dcom.sun.management.jmxremote.port=8686
3. -Dcom.sun.management.jmxremote.ssl=false
4. -Dcom.sun.management.jmxremote.authenticate=false

On UNIX like OS set environment variable CATALINA_OPTS i.e. like this:



export CATALINA_OPTS="-Dcom.sun.management.jmxremote=true 
                      -Dcom.sun.management.jmxremote.port=8686 
                      -Dcom.sun.management.jmxremote.ssl=false 
                      -Dcom.sun.management.jmxremote.authenticate=false"


File TOMCAT_HOME/bin/setenv.sh (if it does not exist, you may create it) or TOMCAT_HOME/bin/catalina.sh

On Windows it might be tricky, that each parameter must be set separately:



set CATALINA_OPTS=-Dcom.sun.management.jmxremote=true
set CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.port=8686
set CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false
set CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.ssl=false



File TOMCAT_HOME/bin/setenv.bat (if it does not exist, you may create it) or TOMCAT_HOME/bin/catalina.bat

With these values, you can use URL



service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi


for connection to JMX server of JVM. No user/password is needed

How to configure JMX on Glassfish

Go to Glasfish admin console (by default accessible on http://localhost:4848

Go to section "Configuration" > "Admin Service" > "system" and set attributes like this:



Figure 13.1. Glassfish JMX connector


With these values, you can use URL


service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi


for connection to JMX server of JVM.

Use admin/adminadmin as user/password. (admin/adminadmin are default glassfish values)

How to configure JMX on Websphere

Websphere does not require any special configuration, but the clover MBean is registered with the name, that depends on application server configuration:


server.api.jmx:cell=[cellName],name=cloverServerJmxMBean,node=[nodeName],process=[instanceName]



Figure 13.2. Websphere configuration



Websphere 6

URL for connecting to JMX server is:


service:jmx:rmi:///jndi/JMXConnector


Following system properties need to be set:

org.omg.CORBA.ORBClass=com.ibm.CORBA.iiop.ORB

java.naming.provider.url=corbaloc:iiop:[host]:[port]/WsnAdminNameService where host is the host name you are connecting to and port

If you have a default Websphere installation, the JNDI port number will likely be 2809, 2810,... depending on how many servers there are installed on one system and the specific one you want to connect to. To be sure, when starting Websphere, check the logs, as it will dump a line like


0000000a RMIConnectorC A ADMC0026I: The RMI Connector is available at port 2810


You will also need to set on the classpath following jar files from Websphere home directory:

/runtimes/com.ibm.ws.admin.client_6.1.0.jar

/runtimes/runtimes/com.ibm.ws.webservices.thinclient_6.1.0.jar

/java/jre/lib/ibmorb.jar

Websphere 7

URL for connecting to JMX server is:


service:jmx:iiop://[host]:[port]/jndi/JMXConnector


where host is the host name you are connectiong to and port


0000000a RMIConnectorC A ADMC0026I: The RMI Connector is available at port 2810


How to configure JMX on Websphere7

Websphere does not require any special configuration, but the clover MBean is registered with the name, that depends on application server configuration:


server.api.jmx:cell=[cellName],name=cloverServerJmxMBean,node=[nodeName],process=[instanceName]




Figure 13.3. Websphere7 configuration



URL for connecting to JMX server is:


service:jmx:iiop://[host]:[port]/jndi/JMXConnector


where host is the host name you are connectiong to and port


0000000a RMIConnectorC A ADMC0026I: The RMI Connector is available at port 2810


You will also need to set on the classpath following jar files from Websphere home directory:

/runtimes/com.ibm.ws.admin.client_7.0.0.jar

/runtimes/com.ibm.ws.ejb.thinclient_7.0.0.jar

/runtimes/com.ibm.ws.orb_7.0.0.jar

Possible problems


  • Default JMX mBean server uses RMI as a transport protocol. Sometimes RMI cannot connect remotely when one of peers uses Java version 1.6. Solution is quite easy, just set these two system properties: -Djava.rmi.server.hostname=[hostname or IP address] -Djava.net.preferIPv4Stack=true