【问题标题】:InstanceNotFoundException when trying to discover queues in Hermes JMS尝试在 Hermes JMS 中发现队列时出现 InstanceNotFoundException
【发布时间】:2018-12-26 14:13:37
【问题描述】:

我有活跃的 MQ 和 Hermes JMS。

activemq.xml 中启用了活动 mq 的 JMX 连接器:

<managementContext>
   <managementContext createConnector="true"/>
 </managementContext>

但是当我尝试在 Hermes JMS 中的活动 mq 会话上发现队列时,我得到 InstanceNotFoundException 异常:

javax.management.InstanceNotFoundException: org.apache.activemq:BrokerName=localhost,Type=Broker
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:643)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1464)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420)
    at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:657)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
    at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttribute(Unknown Source)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttribute(RMIConnector.java:902)
    at hermes.ext.activemq.ActiveMQAdmin.discoverDestinationConfigs(ActiveMQAdmin.java:140)
    at hermes.impl.HermesAdminAdapter.discoverDestinationConfigs(HermesAdminAdapter.java:82)
    at hermes.impl.DefaultHermesImpl.discoverDestinationConfigs(DefaultHermesImpl.java:1126)
    at hermes.browser.tasks.DiscoverDestinationsTask.invoke(DiscoverDestinationsTask.java:77)
    at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
    at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
    at java.lang.Thread.run(Thread.java:724)

我正在使用Hermes 1.14Active MQ 5.9

【问题讨论】:

    标签: jms activemq


    【解决方案1】:

    Hermes JMS 使用JMX 发现代理上的队列。

    Apache 5.8 更改了 JMX MBeans 的名称,这意味着 Active Mq 将找不到它正在寻找的 MBean(因此找不到实例异常)。我尝试使用 Active MQ 5.1 发现队列,并且成功了。

    您无法修复它。 Hermes JMS 的作者必须更新代码以支持 Active MQ 5.8+

    ActiveMQ 5.1 中的 MBean:

    ActiveMQ 5.9 中的 MBean:

    【讨论】:

      【解决方案2】:

      没错,HermesJMS 不支持 ActiveMQ >=5.8 。但是,有一个存储库分支,已实现此更改: https://github.com/paoloantinori/HermesJMS

      我刚刚从存储库安装了 .jar,它可以工作。因此,任何有连接 SoapUI -> HermesJMS -> ActiveMQ 高于 5.8 的相同问题的人,请使用上面 GIT 存储库中的 JAR。

      【讨论】:

        猜你喜欢
        • 2013-11-20
        • 1970-01-01
        • 2021-11-03
        • 2015-03-10
        • 2018-11-07
        • 2011-02-10
        • 1970-01-01
        • 2015-01-05
        • 1970-01-01
        相关资源
        最近更新 更多