uklimaschewski / JMXWrapper

JMXWrapper is a wrapper that allows creation of dynamic JMX MBeans through annotations
Other
41 stars 9 forks source link

Breaks on nested types #21

Open MadMartian opened 2 years ago

MadMartian commented 2 years ago

This seems to work well according to the instructions but it falls short when JMC (Java Mission Control) tries to render objects (even just PoJos) that are attributes of the top-level JMX bean. In JMC all that is displayed for these attributes is "N/A".

In the logs there is a classic "ClassNotFoundException" with the message that the RMI class loader is not enabled.

uklimaschewski commented 2 years ago

How can this be reproduced manually or even better by a unit test? Do you have any idea for a fix or pointers where the problem is in the code?

MadMartian commented 2 years ago

My guess is that com.sun.jmx.mbeanserver.MXBeanSupport of the Java v1.8 RT library clobbers the attributes with POJO reflection introspection. See com.sun.jmx.mbeanserver.MXBeanIntrospector#getMBeanAttributeInfo in particular (again, this may have been fixed since Java 1.8)