Wildfly Artemis ActiveMQ查找失败

时间:2018-11-27 11:11:43

标签: java-ee activemq wildfly javabeans activemq-artemis

我查找队列失败。 que已在wildfly中注册并配置了ironjacamar.xml

野生在开始时输出:

Bound JCA AdminObject [java:jboss/activemq/queue/HELLOWORLDMDBQueue]

ironjacamar 配置:

       <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
            jndi-name="java:jboss/activemq/queue/HELLOWORLDMDBQueue">
            <config-property name="PhysicalName">
                activemq/queue/HELLOWORLDMDBQueue
            </config-property>
        </admin-object>

ra.xml:

   <adminobject>
        <adminobject-interface>javax.jms.Topic</adminobject-interface>
        <adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
        <config-property>
            <config-property-name>PhysicalName</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
        </config-property>
    </adminobject>

我的例外:

Exception in thread "main" javax.jms.InvalidDestinationRuntimeException: Foreign destination:queue://activemq/queue/HELLOWORLDMDBQueue
    at org.apache.activemq.artemis.jms.client.JmsExceptionUtils.convertToRuntimeException(JmsExceptionUtils.java:65)
    at org.apache.activemq.artemis.jms.client.ActiveMQJMSProducer.send(ActiveMQJMSProducer.java:101)
    at org.apache.activemq.artemis.jms.client.ActiveMQJMSProducer.send(ActiveMQJMSProducer.java:121)

我的豆子包括:

@Inject
private JMSContext context;    
@Resource(mappedName = "java:jboss/activemq/queue/HELLOWORLDMDBQueue")
private Queue queue;

我也尝试过:

@Inject
private JMSContext context;    
@Resource(mappedName = "java:/activemq/queue/HELLOWORLDMDBQueue")
private Queue queue;

有人知道我做错了吗?

感谢帮助

1 个答案:

答案 0 :(得分:1)

似乎您正在尝试使用ActiveMQ 5.x JCA资源适配器中的管理对象来配置JMS队列,但是随后您正在使用ActiveMQ Artemis客户端来处理该队列。 ActiveMQ 5.x和ActiveMQ Artemis是完全不同的客户端/服务器实现。您不能那样混合它们。