【发布时间】:2018-01-20 07:08:56
【问题描述】:
我正在使用全新的 ActiveMQ 5.10.0 安装,其中我在名为“测试”的队列中有一条消息。我还替换了 bin/activemq 中的 ACTIVEMQ_SUNJMX 行以启用 JMX:
ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
JMXServiceURL url1 = new
JMXServiceURL("service:jmx:rmi:///jndi/rmi://10.222.222.222:1099/jmxrmi");
JMXConnector jmxc = JMXConnectorFactory.connect(url1);
MBeanServerConnection conn = jmxc.getMBeanServerConnection( );
ObjectName activeMQ = new
ObjectName("org.apache.activemq:type=Broker,BrokerName=TOM");
System.out.println(newProxyInstance(conn, activeMQ, BrokerViewMBean.class, true).toString( ));
Set<ObjectName> brokers = conn.queryNames(activeMQ, null);
if (brokers.size() == 0) {
throw new IOException("No broker could be found in the JMX.");
}
抛出的异常是
Exception in thread "main" java.io.IOException: No broker could be found in
the JMX.
类似于Accessing Apache ActiveMQ via JMX throws Exception,但没有帮助。有什么想法吗?
【问题讨论】: