访问队列/主题

时间:2018-07-06 10:15:26

标签: java jboss

我在standalone-full.xml中创建了主题并排队

<jms-queue name="testQueue" entries="jms/queue/test java:jboss/exported/jms/queue/test"/> <jms-topic name="testTopic" entries="jms/topic/test java:jboss/exported/jms/topic/test"/>

,并且我尝试将消息发送到队列,但是我无法访问队列,并且收到错误消息。你能帮我发现错误吗?

    @Resource(lookup = "java:comp/DefaultJMSConnectionFactory")
    private static ConnectionFactory connectionFactory;
    @Resource(lookup = "jms/queue/test")
    private static Queue queue;
    @Resource(lookup = "jms/topic/test")
    private static Topic topic;
    @Schedule(second="/*40")
    public void onMessage(String body) {
        ...
context.createProducer().send(dest, message);
        ...
        }
    }

11:00:06,576 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "jboss-javaee-webapp.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
    "jboss.naming.context.java.module.jboss-javaee-webapp.jboss-javaee-webapp.env.Producer.queue is missing [jboss.naming.context.java.module.jboss-javaee-webapp.jboss-javaee-webapp.env.jboss.exported.jms.queue.test]",
    "jboss.naming.context.java.module.jboss-javaee-webapp.jboss-javaee-webapp.env.Producer.topic is missing [jboss.naming.context.java.module.jboss-javaee-webapp.jboss-javaee-webapp.env.jboss.exported.jms.topic.test]"
]}

0 个答案:

没有答案