这是我的代码:
domainService = new ObjectName("com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean");
InitialContext ctx = new InitialContext();
mBeanServer = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
ObjectName[] servers = (ObjectName[]) mBeanServer.getAttribute(domainService, "ServerRuntimes");
但我收到了这个错误。我在这里做错了什么?
javax.management.InstanceNotFoundException: com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean^M
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094)^M
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:662)^M
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:638)^M
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$12.run(WLSMBeanServerInterceptorBase.java:326)^M
at java.security.AccessController.doPrivileged(Native Method)^M
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.getAttribute(WLSMBeanServerInterceptorBase.java:324)^M
at weblogic.management.mbeanservers.internal.JMXContextInterceptor.getAttribute(JMXContextInterceptor.java:157)^M
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$12.run(WLSMBeanServerInterceptorBase.java:326)^M
at java.security.AccessController.doPrivileged(Native Method)^M
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.getAttribute(WLSMBeanServerInterceptorBase.java:324)^M
at weblogic.management.mbeanservers.internal.SecurityInterceptor.getAttribute(SecurityInterceptor.java:299)^M
at weblogic.management.jmx.mbeanserver.WLSMBeanServer.getAttribute(WLSMBeanServer.java:279)^M
at com.motive.smp.femto.deploy.wl.utils.WLUtilities.getListMServers(WLUtilities.java:105)^M
at com.motive.smp.femto.deploy.utils.DeploymentUtilsServlet.doGet(DeploymentUtilsServlet.java:58)^M
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)^M
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)^M
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)^