RFR: 7455: Add support for jolokia JMX service connection [v16]

Alex Macdonald aptmac at openjdk.org
Tue Jun 11 14:28:22 UTC 2024


On Sun, 9 Jun 2024 17:41:19 GMT, Martin Skarsaune <duke at openjdk.org> wrote:

>> application/org.openjdk.jmc.jolokia/src/main/java/org/openjdk/jmc/jolokia/JmcJolokiaJmxConnection.java line 110:
>> 
>>> 108: 		try {
>>> 109: 			localInfo = ManagementFactory.getPlatformMBeanServer().getMBeanInfo(name);
>>> 110: 		} catch (Exception | NoClassDefFoundError ignore) {
>> 
>> Does this throw a `NoClassDefFoundError`?  Took a look at https://docs.oracle.com/en/java/javase/17/docs/api/java.management/javax/management/MBeanServer.html#getMBeanInfo(javax.management.ObjectName) and it wasn't in their list of throws. If we're catching Exception anyways and not doing anything specific for the `NoClassDefFoundError` then this could probably just catch Exception instead.
>
> Errors are not neccesarily declared. This is due to an underlying problem in Jolokia that I found while testing JMC manually: https://github.com/jolokia/jolokia/issues/666 . I believe it is safest to build in tolerance, and then we can consider removing it again later.

Sounds good, thanks for the extra context.

-------------

PR Review Comment: https://git.openjdk.org/jmc/pull/548#discussion_r1634989064


More information about the jmc-dev mailing list