How to connect Java Mission Control with EAP remotely?

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)

    • 6.x
    • 7.x
  • Oracle JDK

    • 7 Update 40 (7u40) onwards

Issue

  • How to connect Java Mission Control (jmc) with a EAP 6 server instance?
  • Managed to connect the server instance with jconsole using the jconsole.bat and configuring jmx subsystem. Is there any script to launch jmc?
  • How do we integrate Java Mission Control (jmc) and EAP 6?

Resolution

  • To connect to individual server instances in domain mode, first see Connecting To JBoss Via JConsole in Domain Mode for the pre-requisite configuration changes needed to connect to the individual instances on port 4447 instead of the host controller on port 9999.

  • As per link [1] Java Mission Control tool is started with the release of Oracle JDK 7 Update 40 (7u40), Java Mission Control is bundled with the HotSpot JVM.

  • To connect this jmc with a EAP server instance you can try the following steps:

  • Edit the "jdk1.7.0_51/bin/jmc.ini" file which contains the JVM and JAVA_OPTS related information in this file somewhere at the end users can add the "-Xbootclasspath/a" option to include the "$JBOSS_HOME/bin/client/jboss-client.jar" as following:

-startup
../lib/missioncontrol/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
../lib/missioncontrol/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807
-vm
./java
-vmargs
-XX:+UseG1GC
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
-Djava.net.preferIPv4Stack=true
-Xbootclasspath/a:/jboss-eap-6.2.0/bin/client/jboss-client.jar   <--------NOTICE HERE------>

If Management Interface has https configured, then add the following to the jmc.ini too

-Djavax.net.ssl.trustStore=/path/to/truststore.jks 
-Djavax.net.ssl.trustStorePassword=secret
  • Once the "jmc.ini" file is edited as above then Java Mission Control (jmc) can be started as following:
$JAVA_HOME/bin/jmc
  • Once the Java Mission Control GUI is opened then you will get a Welcome window like this:

    jmc-welcome-screen.png

  • Then you have to close this welcome window and then click on "Create New Custom JVM Connection" icon which is highlighted by the red line in the following screenshot on the "JVM Browser" tab:

    initialwindow1.png

  • Then in the following "JVM Connection" wizard click on "Custom JMX Service URL" button:

    jvmconnection1.png

  • Then Enter the "JMX Service URL" in the below pattern in the following JVM Connection Window:

     service:jmx:remoting-jmx://$HOST:$PORT
Example:
     service:jmx:remoting-jmx://10.10.10.10:9999

For EAP 7

    service:jmx:remote+http://jbosshost:9990
or
  service:jmx:remote+https://jbosshost:9993 
if SSL is enabled.

jvmconnection2.png

  • Enter the JBoss management Username and Password and then click on finish.

  • Now it is connected to JBoss EAP server instance and the similar kind of entry will be added in the JVM Browser:

    jmcwindow2.png

  • After getting connected you can monitor the mbean browser, mbean server, Runtime memory view as follows:

    jmc-mbean-browser.png

    jmc-mbean-server-general-view.png

    jmc-runtime-memory-view.png

  • NOTE: We need to add the "jboss-client.jar" file in the bootclasspath of the jmc because it contains the "remote-jmx" protocol which is specific to JBoss EAP6+ else it will throw Unsupported protocol: remoting-jmx .

[1] Java Mission Control.
[2] To configure Flight Recorder, refer How to use Oracle JDK Java Flight Recorder.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.