我正在尝试运行Oracle JMX示例,包括代理和客户端。代理运行完美,但是当我尝试运行客户端时,我得到一个例外:
Exception in thread "main" java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:154)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:268)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:227)
at com.example.Client.main(Client.java:61)
这是代码出错的部分:
String host = "localhost";
int port = 9999;
String urlString = System.getProperty("jmx.service.url","service:jmx:remoting-jmx://" + host + ":" + port);
JMXServiceURL url = new JMXServiceURL(urlString);
JMXConnector jmxc = JMXConnectorFactory.connect(url);
有谁知道可能导致这种情况的原因?
答案 0 :(得分:0)
我知道这是一个非常老的问题,但是最近我遇到了同样的问题。
就我而言,更新连接器以使用http协议可以成功建立连接。 'remoting-jmx'也已被弃用(https://issues.jboss.org/browse/JBEAP-579),应更新为'remote':
String host = "localhost";
int port = 9999;
String urlString = System.getProperty("jmx.service.url","service:jmx:remote+http://" + host + ":" + port);
JMXServiceURL url = new JMXServiceURL(urlString);
JMXConnector jmxc = JMXConnectorFactory.connect(url);