我正在尝试在Glassfish 4服务器上启动AMX bean。但是,我收到以下错误消息:
javax.management.InstanceNotFoundException: amx-support:type=boot-amx
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:816)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at com.sun.enterprise.v3.admin.DynamicInterceptor.invoke(DynamicInterceptor.java:310)
这是我的电话:
final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
try {
final ObjectName bootMBean = new ObjectName("amx-support:type=boot-amx");
server.invoke(bootMBean, "bootAMX", null, null);
} catch (final MBeanException | ReflectionException | MalformedObjectNameException e) {
...
} catch (final InstanceNotFoundException e) {
...
}
有人知道问题可能在哪里吗?