【问题标题】:Problems with finding queue for JMS communication: "Can't find a resource named..."查找 JMS 通信队列时出现问题:“找不到名为...的资源”
【发布时间】:2016-09-11 09:08:50
【问题描述】:

我正在编写简单的 JMS 应用程序,我正在尝试让消息生产者类通过队列与 MDB 进行通信。我在standalone-full.xml 中添加了适当的声明:

<jms-destinations>
    <jms-queue name="statusQueue">
        <entry name="queue/statusQueue"/>
        <entry name="java:jboss/exported/jms/queue/statusQueue"/>
    </jms-queue>
   .
   .
   .
<jms-destinations>

这就是我试图与消息生产者类中的队列建立连接的方式

@ApplicationScoped
public class Notifier {
    @Resource(mappedName = "java:/ConnectionFactory")
    private ConnectionFactory cf;

    @Resource(mappedName = "java:jboss/exported/jms/queue/statusQueue")
    private Queue queueExample;
    .
    .
    .
}

我得到的错误:

javax.servlet.ServletException: javax.ejb.EJBException: java.lang.IllegalArgumentException: WFLYWELD0049: 将资源注入 CDI 托管 bean 时出错。找不到在私有 javax.jms.Queue persistence.Notifier.queueExample 上定义的名为 java:jboss/exported/jms/queue/statusQueue 的资源

我已经尝试使用InitialContext 进行不带注释的连接,但问题保持不变。我正在使用 Wildfly 10.0.10。对我来说一切似乎都是正确的,可能有什么问题?

【问题讨论】:

    标签: jakarta-ee jboss jms


    【解决方案1】:

    我通过WildFly管理界面创建队列解决了这个问题,可以在http://localhost:8080/输入队列

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 2011-08-31
      • 2011-02-10
      • 2010-09-30
      • 1970-01-01
      • 1970-01-01
      • 2019-03-17
      相关资源
      最近更新 更多