IBM Support

Enabling JMX connection in IBM Sterling B2B Integrator and monitoring IBM Sterling B2B Integrator from remote machine or locally

Technical Blog Post


Abstract

Enabling JMX connection in IBM Sterling B2B Integrator and monitoring IBM Sterling B2B Integrator from remote machine or locally

Body

There are situation where the users and support engineers monitors and requests the application and hardware resource utilization details to narrow down issues. There might be several ways to monitor the application performance and hardware resource utilization. However in this blog i have used jConsole tool to monitor the IBM Sterling B2B application (SBI).

This blog demonstrates step by step details on how to enable JMX connection in SBI so that it can be monitored locally or remotely using tools available.

About JConsole:

JConsole (Java™ Monitoring and Management Console) is a graphical tool which allows the user to monitor and manage the behavior of Java applications.

Note: The preferred tools for monitoring Java applications are the IBM® Monitoring and Diagnostic Tools.

The tool is built on the java.lang.management API which was introduced in Java 5.0. JConsole connects to applications running on the same workstation as itself, or on a remote workstation. The applications must be configured to allow access. JConsole is not part of the core SDK, and it is experimental and unsupported.

When JConsole connects to a Java application, it reports information about the application. The details include memory usage, the running threads, and the loaded classes. This data allows you to monitor the behavior of your application and the JVM. The information is useful in understanding performance problems, memory usage issues, hangs, or deadlocks.

Refer the below link for more details.

https://www-304.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.aix.71.doc/diag/tools/JConsole.html

The jconsole.exe can be found at <JAVA_HOME>/bin directory.

Setting up JMX connection in SBI:

UNIX (Ex: Linux)

1. Stop SBI
2. Edit tmp.sh file and locate Linux section. Then edit the file and add the additional JVM parameter as highlighted. Note that the port number can be anything that is available for use.
=====================================================================================================================================
FROM:
Linux)
ARCH=linux;
AGENT_HEAP_FLAGS="-Xms512m -Xmx1024m"
#If 64-bit JVM, then increase heap size
if [ "${JDK64BIT}" = "true" ]
then
JAVA_FLAGS="${JAVA_FLAGS} -d64"
HEAP_FLAGS="-Xms1280m -Xmx1280m"
ANT_HEAP_FLAGS="-Xms1536m -Xmx1536m"
TO:
Linux)
ARCH=linux;
AGENT_HEAP_FLAGS="-Xms512m -Xmx1024m"
#If 64-bit JVM, then increase heap size
if [ "${JDK64BIT}" = "true" ]
then
JAVA_FLAGS="${JAVA_FLAGS} -d64"
HEAP_FLAGS="-Xms1280m -Xmx1280m -Dcom.sun.management.jmxremote.port=12000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
ANT_HEAP_FLAGS="-Xms1536m -Xmx1536m"
=====================================================================================================================================
3. Start SBI.

Note: Here the parameters are directly added to the tmp.sh file. And I have a used a random port that is available (i.e 12000 in this example). Otherwise the DEBUG_PORT parameter value from sandbox.cfg can be used. If you are making the same changes into the tmp.sh.in file then run the setupfiles.sh to propagate the changes into the tmp.sh file.

Once SBI started successfully, verify these additional parameters are passed as JVM arguments. This can be verified from noapp.log (from <SBI_INSTALL>/logs directory) as highlighted below.

noapp.log:

Running: "/root/SI_524/install/bin/java_wrapper.sh -Xms960m -Xmx1920m -Xmns256m -Xmnx512m -Xjit:exclude={com/yantra/yfc/dom/YFCElement.getChildren*:com/yantra/tools/xsdgen/FileLoaderTree.findDeps*},count=1000 -Xgcpolicy:gencon -Xss256k -Djava.awt.headless=true -Dorg.apache.xml.dtm.DTMManager=org.apache.xml.dtm.ref.DTMManagerDefault -Xdump:heap:none -Xdump:heap:events=systhrow,filter=java/lang/OutOfMemoryError,range=1..4 -Xdump:heap:events=gpf+user -Djava.io.tmpdir=/root/SI_524/install/tmp -d64 -Dcom.sun.management.jmxremote.port=12000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.maverick.ssh.components.ComponentManager.tryStandaloneCryptographyBeforeJCE=true -Dssh.maxWindowSpace=4194304 -Dcom.certicom.tls.record.maximumPaddingLength=0 -Dorg.mortbay.jetty.servlet.AbstractSessionManager.24SessionDestroyed=true -Dvendor=noapp -DvendorFile=/root/SI_524/install/properties/servers.properties -classpath /root/SI_524/install/jar/bootstrapper.jar com.sterlingcommerce.woodstock.noapp.NoAppLoader -f /root/SI_524/install/properties/dynamicclasspath.cfg"

This tells that the additional JVM parameters are added successfully to enable JMX connection and now the application can be monitored using jConsole.

To launch JConsole:

1. Navigate to <JAVA_HOME>/bin directory from any remote machine where JDK/JRE is installed.

2. Click on jconsole.exe and it opens up the below window.

image

3. Enter the Remote Process details as below:

If IP address of the SBI server is 10.11.12.13 and JMX connection port is 12000 then enter the Remote Process as below.

Example: 10.11.12.13:12000

4. Enter username and password for SBI. Once the connection is successful it will display the heap/non-heap memory usage, live thread details, perform GC options etc..

image

Follow the steps below to enable JMX connection on SBI running on windows:

1. Navigate to the <SBI_Install>/bin directory and modify the InstallNoappWindowsService.cmd.in file:
Add the following lines (NOTE: port should match DEBUG_PORT in sandbox.cfg or any free port available) :
rem *************ADDED BY IBM Support***********************
echo -Dcom.sun.management.jmxremote.port=12000>> %PARAM_FILE%
echo -Dcom.sun.management.jmxremote.authenticate=false >> %PARAM_FILE%
echo -Dcom.sun.management.jmxremote.ssl=false >> %PARAM_FILE%
rem ********************************************************
right after this line:
echo -Dcom.certicom.tls.record.maximumPaddingLength=0 >> %PARAM_FILE%
2. Save your changes, then run setupfiles from the same directory.
3. Verify your changes were added to the InstallNoappWindowsService.cmd by setupfiles.
4. Run UninstallWindowsService.cmd followed by InstallWindowsService.cmd

Note: JConsole is a Swing application. You might find that running JConsole on the same workstation as the Java application you want to monitor affects the performance of your Java application. You can use JConsole to connect to a JVM running on a remote workstation to reduce the affect of running JConsole on the application performance.

If there are any queries on this, please post your questions or comments.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11121859