While
implementing ‘JMX: HelloWorld example’ I
faced ‘javax.management.NotCompliantMBeanException’ like below.
Exception in thread "main" javax.management.NotCompliantMBeanException: MBean class com.sample.mbean.interfaces.impl.SystemStatistics does not implement DynamicMBean, and neither follows the Standard MBean conventions (javax.management.NotCompliantMBeanException: Class com.sample.mbean.interfaces.impl.SystemStatistics is not a JMX compliant Standard MBean) nor the MXBean conventions (javax.management.NotCompliantMBeanException: com.sample.mbean.interfaces.impl.SystemStatistics: Class com.sample.mbean.interfaces.impl.SystemStatistics is not a JMX compliant MXBean) at com.sun.jmx.mbeanserver.Introspector.checkCompliance(Introspector.java:176) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:317) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522) at com.sample.app.Application.main(Application.java:18)
After
some analysis, I realized that I placed SystemStatistics class and SystemStatisticsMbean
in different package. I resolved the problem by placing both the interface and
implemented class in the same package.
No comments:
Post a Comment