I am writing simple JMS application and I am trying to make message producer class communicate with MDB via queue. I've added appropriate declaration in 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>
and this is how I am trying to make connection with the queue in the message producer class
@ApplicationScoped
public class Notifier {
@Resource(mappedName = "java:/ConnectionFactory")
private ConnectionFactory cf;
@Resource(mappedName = "java:jboss/exported/jms/queue/statusQueue")
private Queue queueExample;
.
.
.
}
and the error i get:
javax.servlet.ServletException: javax.ejb.EJBException: java.lang.IllegalArgumentException: WFLYWELD0049: Error injecting resource into CDI managed bean. Can't find a resource named java:jboss/exported/jms/queue/statusQueue defined on private javax.jms.Queue persistance.Notifier.queueExample
I've already tried making connection without annotations, using InitialContext
but the poblem stayed the same. I am using Wildfly 10.0.10. Everything seems correct for me, what may be problem?
我通过WildFly管理界面创建了一个队列来解决该问题,该接口可以在http:// localhost:8080 /中输入
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.