1

我正在尝试运行由代理和客户端组成的 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);

有谁知道这可能是什么原因?

4

1 回答 1

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);
于 2019-06-24T11:28:38.873 回答