Community

Monitoring Liberty in Bluemix with JConsole

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:

<featureManager>
<feature>jsp-2.2</feature>
<feature>monitor-1.0</feature>
<feature>restConnector-1.0</feature>
</featureManager>
<basicRegistry>
<user name="jconuser" password="jconpassw0rd"/>
</basicRegistry>
<administrator-role>
<user>jconuser</user>
</administrator-role>
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:
-J-Djavax.net.ssl.trustStore=<java-home>/jre/lib/security/cacerts -J-Djavax.net.ssl.trustStorePassword=changeit -J-Djavax.net.ssl.trustStoreType=jks
Specify appropriate truststore parameters if necessary.

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

The connection should succeed and JConsole will start monitoring.

jcon-monitor

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/logging.properties

Here is a sample logging.properties file:
handlers= java.util.logging.FileHandler
.level=INFO
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
javax.management.level=FINEST
javax.management.remote.level=FINER
com.ibm.level=FINEST

You can also add this to the jconsole comand: -J-Djavax.net.debug=ssl, 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="com.ibm.ws.jmx.*=all"/>

Share this post:

Share on LinkedIn

Add Comment
2 Comments

Leave a Reply

Your email address will not be published.Required fields are marked *


Felipe

Hi Chris, great article… but I can’t access this service in my Liberty Server on Bluemix. I always get the same error:

mar 01, 2016 9:38:35 AM com.ibm.ws.jmx.connector.client.rest.internal.RESTMBeanServerConnection loadJMXServerInfo
GRAVE: CWWKX0203E: O cliente REST do Java Management Extensions do WebSphere recebeu um código de resposta 404 inesperado com a mensagem ‘Not Found’ a partir do servidor para a URL https://brf-app-core.mybluemix.net:443/IBMJMXConnectorREST na conexão rest:brf-app-core.mybluemix.net:443

Reply

Nikhil

Hello,

Thanks for this great article. This really helps.

Wanted to ask you, if there is a JMX endpoint exposed by Bluemix platform using which the performance of all the individual infrastructure components of the Bluemix platform such as the Cloud Controller, HAA etc could be monitored using JConsole or JMX ?

Reply
More Community Stories

IBM acquires StrongLoop – Helping clients extend their enterprise reach

The team at StrongLoop, Inc. helps companies succeed in connecting mobile, Internet of Things (IoT) and next-generation web applications with enterprise data and services in a hybrid cloud environment. Today, IBM announced that it acquired StrongLoop to help you accelerate your digital transformation.

Bluemix in the News

Too busy coding to keep up with all the exciting happenings in the Bluemix world? Well don’t worry! This concise post will summarize announcements, videos, and events that Bluemix has been involved in because we understand your busy schedule, but we also know your desire to learn more about Bluemix!

IBM Cloud gets creative with the Urban Art Cloud

Where did all of those lines, however hazy, between entertainment, art, advertising, selling, informing, and communing go? Boy did that question date me. Anyway, from the resulting soup of those disappearing lines comes a lot of new opportunities to do things like demonstrate transformative technology and encourage individual creativity at the same time. The IBM Urban Art Cloud is a good example that showcases the flexibility and scalability of SoftLayer along with the speed, variety, and freedom of the Bluemix cloud-based development tools.