Websphere Liberty Profile JMX Service URL

The localhost JMX service URL for a liberty profile Websphere instance can be found in the following file once the server is started:

.../wlp/usr/servers/defaultServer/workarea/com.ibm.ws.jmx.local.address

It’ll contain the URL to connect to the JMX server:

service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW98ZS5ybWkuUk1J... (omitted)

It can be used directly in a JMXServiceURL(); on your java code, but beware the URL will change each time the server is restarted.