【问题标题】:Wildfly Artemis ActiveMQ lookup failWildfly Artemis ActiveMQ 查找失败
【发布时间】:2019-04-29 02:49:42
【问题描述】:

我查找 que 失败。 que在wildfly中注册并使用ironjacamar.xml配置

wildfly 启动时输出:

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)

我的 Bean 包括:

@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;

有人知道我做错了什么吗?

感谢您的帮助

【问题讨论】:

    标签: jakarta-ee wildfly javabeans activemq-artemis


    【解决方案1】:

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

    【讨论】:

    • 所以基本上我使用了错误的适配器资源?首先我使用旧的activemq 5.x,但我有同样的错误,所以我尝试了artemis。但接下来我会尝试使用 artemis 适配器。谢谢
    • 实际使用哪个资源适配器并不重要。你只需要匹配资源适配器和客户端。
    • 我现在都试过了。我更新到 Artemis ActiveMQ 并得到了同样的错误:-/ 我可以监听队列,但不能向队列发送任何信息。
    • 这里基本上不可能诊断出cmets中的问题。提出一个新问题,详细说明您的新配置。
    • stackoverflow.com/questions/53828796/… 这是我的新问题。感谢您的帮助!
    猜你喜欢
    • 2019-05-18
    • 2019-11-14
    • 2016-11-18
    • 2019-03-08
    • 1970-01-01
    • 2017-03-13
    • 2019-01-24
    • 2016-12-10
    • 2022-10-18
    相关资源
    最近更新 更多