MBean compliance test doesn't support covariant return types in MBean interfaces.
For instance:
public interface ParentMBean {
public Object getState();
public void setState(Object state);
}
public interface ChildMBean extends ParentMBean {
public String getState();
public void setState(String state);
}
The code above compiles but when trying to register a ChildMBean
in the MBeanServer the following exception is thrown:
Exception in thread "main" javax.management.NotCompliantMBeanException: Type mismatch between parameters of get or isState, setState methods
at com.sun.jmx.mbeanserver.Introspector.testConsistency(Introspector.java:399)
at com.sun.jmx.mbeanserver.Introspector.introspect(Introspector.java:348)
at com.sun.jmx.mbeanserver.Introspector.testCompliance(Introspector.java:208)
at com.sun.jmx.mbeanserver.Introspector.testCompliance(Introspector.java:150)
at com.sun.jmx.mbeanserver.StandardMetaDataImpl.buildMBeanInfo(StandardMetaDataImpl.java:116)
at com.sun.jmx.mbeanserver.StandardMetaDataImpl.testCompliance(StandardMetaDataImpl.java:149)
at com.sun.jmx.mbeanserver.MetaDataImpl.testCompliance(MetaDataImpl.java:125)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:211)
at com.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:301)
at Main.main(Main.java:26)
###@###.### 11/4/04 09:36 GMT