I am unable to change attribute of the registered MBean in JMC (v 7.1), jdk1.8.0_172
However, I am able to change it in jconsole
MBean definitions and registration:
public class ProfilingController implements ProfilingControllerMBean {
private boolean enabled = false;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}
public interface ProfilingControllerMBean {
void setEnabled(boolean enabled);
}
ManagementFactory.getPlatformMBeanServer().registerMBean(controller, new ObjectName("AppProfiling", "name", "ProfilingController"));
I encountered the same problem. I use java 21, JDK Mission Control 8.3.1+b05 problem
I noticed the error message "Could not find attribute Enabled" and decided to add a get method to the interface and everything worked.
Perhaps somewhere there is a description of the MBean convention and everything is described there.
decided I hope it will be useful to someone.