Enabling JMX Access to a JVM: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 29: Line 29:
=Attach API=
=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.


<font color=red>
An “attach” playground project that creates a jar that lists the VirtualMachineDescriptor. Document how to run it, document that we need tools.jar.
</font>


=WildFly and JMX=
=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]].
For specifics on how to attach a generic JMX client to a WildFly instance, see:
 
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
:[[WildFly and JMX]]
</blockquote>

Latest revision as of 20:54, 8 February 2017

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.

An “attach” playground project that creates a jar that lists the VirtualMachineDescriptor. Document how to run it, document that we need tools.jar.

WildFly and JMX

For specifics on how to attach a generic JMX client to a WildFly instance, see:

WildFly and JMX