Enabling JMX Access to a JVM

From NovaOrdis Knowledge Base
Revision as of 05:13, 15 October 2016 by Ovidiu (talk | contribs) (→‎Attach API)
Jump to navigation Jump to search

Internal


TODO

Overview

Is this the "remote mode"?

-Dcom.sun.management.jmxremote

More on this and the Attach API (Java 6 and beyond).


Parse and translate http://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html

Until Java 6, in order to make a JVM accessible to a JMX client, it had to be started with -Dcom.sun.management.jmxremote command line option. A JMX client can access a JVM using a "local mode" (The attach API? Is this what VisualVM uses when attaching to "Local"? or a "remote mode" (see Enabling JMX Access to a JVM below).

Attach API

For Java 6 and beyond, a JMX client can connect using the Attach API. Attach API can only be used by JMX clients that run on the same host. The JMX client needs access to tools.jar that comes with the JDK that runs the target Java process, and also need the PID of the target Java process.

WildFly and JMX

This is NOT the preferred method to connect to a WildFly instance with a JMX client. For more details see WildFly and JMX.