How To Connect To EAP 6 Via JConsole Without Using jconsole.sh/jconsole.bat
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
- We do not want to install JBoss EAP on our client machine in order to connect to JBoss via jconsole.
- Is there a way out where we can use the jconsole that comes with Java.
Resolution
jconsole.sh/jconsole.bat distributed with JBoss EAP 6 uses JConsole (distributed with Java). However, some additional libraries (from the JBoss install) are put on the classpath. So, at the very least, you will need those JARs on the client machine when running JConsole. The result would be something like such (on a Linux machine):
jconsole -J-Djava.class.path=/path/to/java/jdk7_45/lib/jconsole.jar:/path/to/java/jdk7_45/lib/tools.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/remoting-jmx/main/remoting-jmx-1.1.2.Final-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/remoting3/main/jboss-remoting-3.2.18.GA-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.2.GA-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/xnio/main/xnio-api-3.0.7.GA-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/xnio/nio/main/xnio-nio-3.0.7.GA-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/sasl/main/jboss-sasl-1.0.3.Final-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/marshalling/main/jboss-marshalling-1.4.2.Final-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/marshalling/river/main/jboss-marshalling-river-1.4.2.Final-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/as/cli/main/jboss-as-cli-7.3.0.Final-redhat-14.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/staxmapper/main/staxmapper-1.1.0.Final-redhat-2.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/as/protocol/main/jboss-as-protocol-7.3.0.Final-redhat-14.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/dmr/main/jboss-dmr-1.2.0.Final-redhat-1.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/as/controller-client/main/jboss-as-controller-client-7.3.0.Final-redhat-14.jar:/path/to/jboss-eap-6.2/modules/system/layers/base/org/jboss/threads/main/jboss-threads-2.1.1.Final-redhat-1.jar
With EAP 6.2 CP01 (and beyond), the jconsole script/bat was altered, allowing one to place jboss-cli-client.jar on the classpath as oppose to the JBoss specific libraries from the modules. The result would be something like such (on a Linux machine):
jconsole -J-Djava.class.path=/path/to/java/jdk7_45/lib/jconsole.jar:/path/to/java/jboss/java/jdk7_45/lib/tools.jar:/path/to/jboss-eap-6.2/bin/client/jboss-cli-client.jar
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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
