Monitoring Liberty in Bluemix with JConsole

Share this post:

To monitor the Bluemix Liberty runtime with JConsole, you must complete the following steps:

  1. Push your application within a server package containing an appropriate server.xml.
  2. Start the JConsole application with the appropriate system properties on the command line.
  3. Provide the proper Remote Process url, Username, and Password to JConsole.

Here is more detail on each of the above steps.

1. Push the server package containing your application limiting it to a single instance.  This is the default (-i=1).  Your server.xml must contain the monitor-1.0 and restConnector-1.0 features.  It also must contain a basicRegistry element and administrator-role element as shown below:

<user name="jconuser" password="jconpassw0rd"/>
NOTE: The password should be encoded with the securityUtility tool provided with Liberty.

2.  JConsole is included with your java installation.  Go to <java-home>/bin (java 1.7 or higher) and run this command:
jconsole -J-Djava.class.path=<java-home>/lib/jconsole.jar;<liberty-home>/wlp/clients/restConnector.jar

The truststore parameters will take the following defaults that should work in most cases:<java-home>/jre/lib/security/cacerts
Specify appropriate truststore parameters if necessary.

3. Fill in the Remote Process field with this url:  service:jmx:rest://<appName>  Also fill in the Username and Password fields with an administrator-role role user and password from the server.xml.  Click Connect.

The connection should succeed and JConsole will start monitoring.


If your connection fails, you can produce logs to help diagnose the problem.  First, try collecting client side trace by adding this to the jconsole command: -J-Djava.util.logging.config.file=c:/tmp/

Here is a sample file:
handlers= java.util.logging.FileHandler
java.util.logging.FileHandler.pattern = /tmp/jmxtrace.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

You can also add this to the jconsole comand:, which will produce SSL diagnostic tracing in a separate JConsole output window.  Lastly, you can enable tracing on the server side by adding this to your server.xml: <logging traceSpecification="*=all"/>

More stories

Announcing App ID integration to IBM Cloud Kubernetes Service

Today, we're excited to announce App ID integration with IBM Cloud Kubernetes Service. You can use this integration to enforce policy-driven security in a consistent way using declarative configuration of the Ingress Controller to add App ID protection for web applications, APIs, and back-ends. Using this approach, you don’t have to instrument each of your applications separately - all the authorization and authentication flows will be handled automatically for you. No code change is required!

Continue reading

Deploying to IBM Cloud Private with IBM Cloud Developer Tools CLI

IBM Cloud Private is an application platform for developing and managing on-premises, containerized applications. It is an integrated environment for managing containers that includes the container orchestrator Kubernetes, a private image repository, a management console, and monitoring frameworks.

Continue reading

IBM Cloud Garage Method Field Guide

What does it mean to behave like a startup? How can you transform your business? Field-tested answers to these questions and others are found in the IBM Cloud Garage Method Field Guide. Presented in a fun and visual format, the Field Guide introduces the method and its related practices and architectures that you need to quickly develop quality products.

Continue reading