【问题标题】:Not an ActiveMQ Artemis Destination exception4不是 ActiveMQ Artemis 目标异常4
【发布时间】:2020-06-30 19:51:58
【问题描述】:

我有在 Jboss server 7.0 上运行的带有 Spring 的 Java 应用程序。我正在尝试将它与 IBM mq 适配器集成我已经部署了 wmq.jmsra.rar 适配器并将其配置如下:

<subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">
            <resource-adapters>
                <resource-adapter id="wmq.jmsra.rar">
                    <archive>
                        wmq.jmsra.rar
                    </archive>
                    <transaction-support>NoTransaction</transaction-support>
                    <connection-definitions>
                        <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/exported/jms/MQConnectionFactory" tracking="false" pool-name="mq-my-app">
                            <config-property name="hostName">127.0.0.1</config-property>
                            <config-property name="port">1414</config-property>
                            <config-property name="channel">SYSTEM.ADMIN.SVRCONN</config-property>
                            <config-property name="transportType">CLIENT</config-property>
                            <config-property name="queueManager">MQ1</config-property>
                            <config-property name="username">admin</config-property>
                            <config-property name="password">passw0rd</config-property>
                        </connection-definition>
                    </connection-definitions>
                    <admin-objects>
                        <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/exported/jms/MQRequestQueue" pool-name="queue-req">
                            <config-property name="baseQueueManagerName">MQ1</config-property>
                            <config-property name="baseQueueName">DEV.QUEUE.1</config-property>
                        </admin-object>
                        <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/exported/jms/MQResponseQueue" pool-name="queue-res">
                            <config-property name="baseQueueManagerName">MQ1</config-property>
                            <config-property name="baseQueueName">DEV.QUEUE.2</config-property>
                        </admin-object>
                    </admin-objects>
                </resource-adapter>
            </resource-adapters>
        </subsystem>

我的 IBM 服务器在 docker 上运行,并通过 localhost 地址访问。

在我的带有 Spring 上下文的 java 应用程序中,我在应用程序启动时通过 jndi 访问 mq 队列,当我尝试发送消息时出现以下错误:

"java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bankAdapterImpl': Invocation of init method failed; nested exception is org.springframework.jms.InvalidDestinationException: Not an ActiveMQ Artemis Destination:com.ibm.mq.connector.outbound.MQQueueProxy@4d1be475; nested exception is javax.jms.InvalidDestinationException: Not an ActiveMQ Artemis Destination:com.ibm.mq.connector.outbound.MQQueueProxy@4d1be475

编辑: 我使用 jndi 访问的方式

 public static final String CONNECTION_FACTORY_NAME = "jboss/exported/jms/MQConnectionFactory";

 public static final String REQUEST_QUEUE_NAME = "jboss/exported/jms/MQRequestQueue";

...
Context jndiContext = new InitialContext();
        return (Destination) jndiContext.lookup(REQUEST_QUEUE_NAME);
...

【问题讨论】:

标签: java spring jboss ibm-mq


【解决方案1】:

好的,我知道了问题所在,我正在使用另一个 jms 模板对象,该对象使用默认的 Artemis Mq 客户端,而不是我通过 jndi 访问的那个。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-13
    • 1970-01-01
    • 1970-01-01
    • 2020-10-09
    • 2020-03-26
    • 2021-10-09
    • 2021-09-02
    • 1970-01-01
    相关资源
    最近更新 更多