RFR: 7455: Add support for jolokia JMX service connection [v6]
Martin Skarsaune
duke at openjdk.org
Sun Feb 4 21:31:06 UTC 2024
On Sun, 4 Feb 2024 16:32:19 GMT, Martin Skarsaune <duke at openjdk.org> wrote:
> Ok, so at least in JMC 7.1.0 and 8.3.0 this use to work by the fact that the plugin uses the extension point for JMX protocol: https://github.com/skarsaune/jmc/blob/e2c2275d05ee2e2215ea2a48b720ef2fef456810/application/org.openjdk.jmc.jolokia/plugin.xml#L43 However this no longer seems to work in 9.0.0 :(?). Does anyone know about particular changes in this area?
>
> For instance when trying to connect to a JMC console from the JVM browser I get this:
>
> `!ENTRY org.openjdk.jmc.console.ui 4 4 2024-02-04 17:14:27.250 !MESSAGE Could not connect to 127.0.0.1:8778 : Unsupported protocol: jolokia !STACK 0 org.openjdk.jmc.rjmx.common.ConnectionException caused by java.net.MalformedURLException: Unsupported protocol: jolokia at org.openjdk.jmc.rjmx.common.internal.RJMXConnection.connect(RJMXConnection.java:364) at org.openjdk.jmc.rjmx.internal.ServerHandle.doConnect(ServerHandle.java:121) at org.openjdk.jmc.rjmx.internal.ServerHandle.connect(ServerHandle.java:111) at org.openjdk.jmc.console.ui.editor.internal.ConsoleEditor$ConnectJob.run(ConsoleEditor.java:99) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: java.net.MalformedURLException: Unsupported protocol: jolokia at java.management/javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:366) at org.openjdk.jmc.rjmx.common.internal.RJMXConnection.connectJmxConnector(RJMXConnection.java:591) at org.openjdk.jmc.rjmx.common.internal.RJ
MXConnection.establishConnection(RJMXConnection.java:572) at org.openjdk.jmc.rjmx.common.internal.RJMXConnection.connect(RJMXConnection.java:357) ... 4 more `
>
> This appears to use Javas native JMXConnectorFactory directly . This may fail for a number of reasons:
>
> 1. Jolokia _does_ support service discovery, but only if the Jolokia library jar is on the classpath/same classsloader.
> 2. Furthermore this rules out providing a JMC specific connection that could allow us to put in optimizations for JMC.
>
> Anyone know more about the setup of connections or how this may have changed recently.
Hmm, or is `OsgiServicesJmxProviderProxy` supposed to be picked up by `JMXConnectorFactory`, and that in turn will use the protocol providers registered in JMC?. Do you know @aptmac ?
-------------
PR Comment: https://git.openjdk.org/jmc/pull/548#issuecomment-1925923700
More information about the jmc-dev
mailing list