0

I need to add a JMXMP listener to an existing Java application without changing any code. The classic RMI based protocol doesn't work in the target environment do to firewall restrictions.

In other words: I would like to access the JMX of the process just by adding the jmx_remote-optional to the classpath and some env properties analog to com.sun.management.jmxremote for the RMI connector.

I couldn't find anything in the various docs out there - I managed to use JMXMP in the target env with Tomcat (adding a LifecycleEventListener that reads the port from the config) and another program where I explicitly started the listener.

csar
  • 16
  • 2
  • 4

1 Answers1

0

Take a look at my github project JMXMPAgent. Docs are a little light, but the premise is simple.

  1. Clone the repo
  2. Build with mvn clean install
  3. Install the agent into a running JVM using the PID of the target JVM, the desired JMXMP listening port, binding interface and target MBeanServer default domain as in the following example. It assumes a PID and the default JMX domain.

java -jar target/helios-jmxmp-agent-1.0-SNAPSHOT.jar -install 11121 8334:127.0.0.1:DefaultDomain

Nicholas
  • 15,916
  • 4
  • 42
  • 66