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?