【发布时间】:2011-10-10 02:21:37
【问题描述】:
我在文件my-hornetq-jms.xml中有一个JMS-Queue的简单定义:
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
<queue name="my.test.queue">
<entry name="/queue/myTest"/>
</queue>
</configuration>
队列已正确激活,现在我想在我的@Stateless Bean 中添加一个依赖项。这个问题类似于How can I ensure that the hornet queues are there when my webapp starts in JBOSS 6.0?,但是我想用注解定义依赖。我试过这个(在几个排列中),但没有找到正确的方法:
@Depends(value="org.hornetq:module=JMS,type=Queue,name=my.test.queue")
我总是收到这样的错误:
Dependency "<UNKNOWN jboss.j2ee:jar=my.war,name=MyBean,service=EJB3>"
(should be in state "Installed", but is actually in state "** UNRESOLVED Demands
'org.hornetq:module=JMS,name=my.test.queue,type=Queue' **")
顺便说一句:在 JBoss-5 中我这样定义它:@Depends(value = "jboss.messaging.destination:service=Queue,name=my.test.queue")
【问题讨论】: