Configuring local JMX connection to Liberty

You can access the local Java™ Management Extensions (JMX) connector on Liberty. The local connector is enabled through the Liberty feature localConnector-1.0.

About this task

The local connector is enabled through the Liberty feature localConnector-1.0. Access through the local connector is protected by the policy implemented by the SDK in use. Currently the SDKs require that the client runs on the same host as Liberty, and under the same user ID.

Note: An application deployed on Liberty has unrestricted access to its MBeanServer directory.

The following section describes how to configure and access the local connector on Liberty.

Procedure

  1. Enable the local connector by using the following code in the server.xml file.
    <featureManager>
         <feature>localConnector-1.0</feature>
    </featureManager>
  2. Access the local connector by using the JConsole tool or the JMX client that is installed on the same host.
    • Copy the contents of ${server.output.dir}/logs/state/com.ibm.ws.jmx.local.address to the clipboard.
    • For the JConsole tool, paste the contents of the clipboard into the Remote Process field. If, on the connection panel, you select the local process ws-server.jar defaultServer, then click Connect, you are using the JDK bridge to connect to the MBeanServer. The Liberty bridge is more reliable.
    • For the JMX client, paste the contents of the clipboard into the constructor of a javax.management.remote.JMXServiceURL object. Use that JMXServiceURL to establish a connection through javax.management.remote.JMXConnectorFactory. If the JMX client is running on the same JVM as Liberty, you do not have to use the connector, instead you can access the MBeanServer directly. For more information, see Working with JMX MBeans on Liberty.