Configure local JMX connection to Liberty

We can access the local Java Management Extensions (JMX) connector on Liberty. The local connector is enabled through the Liberty feature localConnector-1.0. 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.

For sample Liberty admin scripts, see:

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.

  1. Enable the local connector using the following code in the server.xml file.

      <featureManager>
           <feature>localConnector-1.0</feature>
      </featureManager>

  2. Access the local connector using the JConsole tool or the JMX client 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, we 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, we do not have to use the connector, instead we can access the MBeanServer directly. For more information, see Working with JMX MBeans on Liberty.