That was my question too, last week.
JConsole, and MX4J http-adaptor show both an error like:
Error during MBean operation invocationMessage: null nested exception is javax.management.ServiceNotFoundException: Operation descriptor field 'role' must be 'operation', not getter'
after invoking these 'getter-operations'.
Commenting out
Code:
// Attributes need to have their methods exposed as
// operations to the JMX server as well.
info = createModelMBeanOperationInfo(method, pd.getName(), beanKey);
Descriptor desc = info.getDescriptor();
if (method.equals(pd.getReadMethod())) {
desc.setField(FIELD_ROLE, ROLE_GETTER);
}
else {
desc.setField(FIELD_ROLE, ROLE_SETTER);
}
desc.setField(FIELD_VISIBILITY, ATTRIBUTE_OPERATION_VISIBILITY);
if (isExposeClassDescriptor()) {
desc.setField(FIELD_CLASS, getClassForDescriptor(managedBean).getName());
}
info.setDescriptor(desc);
in
Code:
protected ModelMBeanOperationInfo[] getOperationInfo(Object managedBean, String beanKey)
from
Code:
org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler.java
seems to work for me...