Join GitHub today
InstanceNotFoundException can be avoided in MBeanServerExecutorLocal #76
We are using latest(1.1.0-SNAPSHOT) code from integration branch for jolokia-osgi module. It works properly but there is one minor issue.
The method "private MBeanServer lookupJolokiaMBeanServer()" uses InstanceNotFoundException thrown by MBeanServer to check if the "jolokia:type=MBeanServer" bean is already registered. Our problem is that we log all exceptions thrown by MBeanServer and the InstanceNotFoundException from lookupJolokiaMBeanServer is logged by our logger. We would like to avoid it.
There is a simple solution for this and insted of relying on InstanceNotFoundException the check in lookupJolokiaMBeanServer() can be performed by utilising MBeanServer.isRegistered(...) method.
The fix would be :
I can see your point (and yes, I know about