Setting up JMX connectivity for MDM 8.3.x running on JBoss AS7.1.1.Final for both Local and Remote JMX Access.

Setting up JMX connectivity for MDM 8.3.x running on JBoss AS7.1.1.Final for both Local and Remote JMX Access.

book

Article ID: KB0093345

calendar_today

Updated On:

Products Versions
TIBCO MDM -
Not Applicable -

Description

Resolution:

Introduction.


The standard jconsole.exe and jvisualvm.exe provided in the Java JDK bin directory do not work with JBoss.  Instead, the JBOSS_HOME/bin/jconsole(.bat or .sh) and JBOSS_HOME/bin/jvisualvm.sh script files provided out of the box with JBoss AS 7.1.1.Final needs to be used. This KB Article explains how to correctly set up JMX connectivity for MDM 8.3.x running on JBOSS AS7.1.1.Final for both Local and Remote JMX Access.

Starting up Jconsole / Jvisualvm Locally on a Server where JBoss is present.

If running jconsole and jvisualvm locally, the following script files need to be used :

$JBOSS_HOME/bin/jconsole.sh / $JBOSS_HOME/bin/jvisualvm.sh       (Linux)
%JBOSS_HOME%\bin\jconsole.bat / %JBOSS_HOME%\bin\jvisualvm.bat   (Windows)

Note that in the case of Windows, jvisualvm.bat is not defined by default, so it is necessary to copy jconsole.bat to jvisualvm.bat and then change the line:

"%JAVA_HOME%\bin\jconsole.exe" -J"-Djava.class.path=%CLASSPATH%"

to read:

"%JAVA_HOME%\bin\jvisualvm.exe" -cp:a "%CLASSPATH%"  --console suppress

Starting up Jconsole / Jvisualvm Remote to a Server where JBoss is present (that is, no JBoss on the local machine).

To run jconsole or jvisualvm on a remote machine, if that remote machine does not have JBoss installed, certain JBoss module JAR files (files under JBOSS_HOME/module), as well as jconsole.sh/jvisualvm.sh / jconsole.bat/jvisualvm.bat, need to be copied, preserving the module directory structure.

Required JBOSS Libraries

The required JBoss module JAR files (for connecting to a JBoss AS 7.1.1.final server), together with the jconsole.bat and jvisualvm.bat Windows batch files and jconsole.sh and jvisualvm.sh Linux script files, have been zipped up into a single zip file and attached to this KB Article (Filename: jboss_jmx.zip). It is ready to deploy to a remote workstation.

1). To use the zip file, first create a dedicated new directory:

# mkdir -p /opt/jboss_jmx  (Linux)
C:> mkdir C:\jboss_jmx     (Windows)


2). Download and unzip the attached zip file to the newly created directory.

3). Define a global environment variable JBOSS_HOME:

export JBOSS_HOME=/opt/jboss_jmx    (Linux, set either in ~/.profile or ~/.bash_profile, dependent on the shell being used)
Computer - Properties - Advanced System Settings - Advanced - Environment Variables... JBOSS_HOME=C:\jboss_jmx    (Windows)


4). With JBOSS_HOME defined and the files unzipped, open up a command window. At the command line, change to the dedicated directory and then execute either jconsole or jvisualvm as follows:

Linux:
# cd /opt/jboss_jmx
# ./jconsole.sh       # for jconsole
# ./jvisualvm.sh      # for jvisualvm

Windows:
C:> cd C:\jboss_jmx
C:> jconsole.bat      # for jconsole
C:> jvisualvm.bat     # for jvisualvm

Connecting to the JBoss MDM server with Jconsole once Jconsole is Started.

Whether running locally or remotely, when the relevant connection window appears, enter the following into the Remote Process box:

service:jmx:remoting-jmx://<jboss_server>:9999

where <jboss_server> is the either the IP or hostname of the Jboss server, and then provide a valid AdministrationRealm Username and Password. Having provided these details, select Connect. A pop-up window will appear and jconsole will connect. If the connect fails, exit and restart jconsole.bat and repeat the connect process. Do so up to four times to make sure any old connection details that may be causing issues are cleared.


Connecting to the JBoss MDM server with Jvisualvm once Jvisualvm is Started

Whether running locally or remotely, when the relevant connection window appears, right mouse-click on "Remote" and select "Add remote host". Type in a suitable host name or IP - jvisualvm will then search for the host.  If found, it will add the host to the Remote list. Right click on the newly added host and select "Add JMX Connection...".  In the connection box, replace the host details with:

service:jmx:remoting-jmx://<jboss_server>:9999

where <jboss_server> is the either the IP or hostname of the JBoss server. Check "Use security credentials", then check "Save security credentials". Finally provide a valid AdministrationRealm Username and Password. The security credentials need to have been previously defined using $JBOSS_HOME/bin/add-user.sh / %JBOSS_HOME%\bin\add-user.bat on the MDM server.

Having checked "Use security credentials" and "Save security credentials", provided the connection protocol string and enter the security credential. Click on OK. jvisualvm will connect. If it fails to connect the first time, exit, restart jvisualvm.bat and repeat the connect process (although you likely won't have to recreate the remote host again).  In jvisualvm, once a connection has been set up, it will be reconnected each time jvisualvm is restarted until it is deleted.


Notes on 1.Credentials;2.Ports;3.Port Offsets;4.Ensuring the Management Interface is Open for Remote Access;5.jboss-modules.jar .

Note 1: The security credentials used in defining JMX-based connections to MDM need to have been previously defined using:


$JBOSS_HOME/bin/add-user.sh    (Linux)

%JBOSS_HOME%\bin\add-user.bat  (Windows)


on the MDM server.  By convention, 'admin' is the normal username to use.


Note 2: The reason you provide an AdministrationRealm username and password is because of the remoting entry in standalone.xml:

<subsystem xmlns="urn:jboss:domain:remoting:1.1">
    <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
</subsystem>


Note 3: The port number 9999 is the default for the management(-native) port, as defined in the scket-binding-group in standalone.xml:

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
    <socket-binding name="management-http" interface="public" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="ajp" port="8009"/>
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    <socket-binding name="osgi-http" interface="management" port="8090"/>
    <socket-binding name="remoting" port="4447"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

If jboss.management.native.port is set to a value other than 9999 or jboss.socket.binding.port-offset is set to a value other than 0, the correct port or port+offset number needs to be used instead: new values for jboss.management.native.port and jboss.socket.binding.port-offset can be provided using the JVM -D parameter mechanism. The default values after the colon in standalone.xml are only used where -D values are not specified. This point is important if it is found that it is not possible to connect to the JMX console using 9999 when it otherwise should be. In this case, in addition to checking the "colon" default values in JBOSS_HOME/standalone/configuration/standalone.xml, it is also advisable to check JBOSS_HOME/bin/standalone.conf(.bat) and JBOSS_HOME/bin/standalone (.sh or .bat), to see if -Djboss.management.native.port=... and/or -Djboss.socket.binding.port-offset=... have been used.


Note 4: remote connections to a JBoss AS7.1.1.Final Server won't work unless the following JVM argument has been added to JAVA_OPTS in:

$JBOSS_HOME/bin/standalone.conf        (Linux)
%JBOSS_HOME%\bin\standalone.conf.bat   (Windows)

on the JBOSS MDM server

JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address.management=0.0.0.0"           (Linux)
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.bind.address.management=0.0.0.0"      (Windows)

to "open up" the management port (9999) to remote clients. If it proves to be necessary to add the management bind address parameter, it is also required that the JBoss MDM server be restarted before any connections using Jconsole, Jvisualvm or other JMX-based tool are attempted.


Note 5: If not already there, the jar file jboss-modules.jar (available from the JBoss download site) needs to be placed in the JBOSS_HOME directory.

Issue/Introduction

Setting up JMX connectivity for MDM 8.3.x running on JBoss AS7.1.1.Final for both Local and Remote JMX Access.

Attachments

Setting up JMX connectivity for MDM 8.3.x running on JBoss AS7.1.1.Final for both Local and Remote JMX Access. get_app