title: resource injection in cdi bean
body: <p>I'm not sure if this is supposed to work, but i'm trying to write a JMS producer with cdi with wildfly and stuck at injecting resources into a cdi managed bean:</p>
  
  <pre><code>public class CdiProducer {
      @Resource(name = "java:jboss/DefaultJMSConnectionFactory")
      @Produces
      QueueConnectionFactory qcf;
  
      @Resource(name = "java:/queue/HELLOWORLDMDBQueue")
      @Produces
      @Hello
      Queue helloWordQueue;
  </code></pre>
  
  <p>Running this I'm getting the following error:</p>
  
  <p>JBAS016076: Error injecting resource into CDI managed bean. Can't find a resource named ...</p>
  
  <p>What is very strange however is, when i copy&amp;paste the resources into a enterprise bean, everything works!</p>
  
  <pre><code>@Stateless
  public class QueueSender {
      @Resource(name="java:jboss/DefaultJMSConnectionFactory")
      QueueConnectionFactory qcf;
  
      @Resource(name="java:/queue/HELLOWORLDMDBQueue")
      Queue helloWordQueue;
  </code></pre>
  
  <p>Queue is defined as:</p>
  
  <pre><code>  &lt;jms-destinations&gt;
       &lt;jms-queue name="HelloWorldQueue"&gt;
          &lt;entry name="/queue/HELLOWORLDMDBQueue"/&gt;
          &lt;entry name="java:jboss/exported/queue/HELLOWORLDMDBQueue"/&gt;
       &lt;/jms-queue&gt;
    &lt;/jms-destinations&gt;
  </code></pre>
  
  <p>Is this supposed to work this way? Or is a bug in wildfly?</p>