5 Replies Latest reply on Jun 22, 2009 9:44 AM by Carlo de Wolf

    Queue injection in JBoss 5 not working ?

    ermes martino Newbie

      Hi all !
      I'm trying to inject a Queue as a @Resource into my EJB.

       @Stateless
       @WebService
      
       public class WebServiceBean implements EJBWebService {
      
       @Resource(mappedName="java:/ConnectionFactory")
       ConnectionFactory factory;
       @Resource(mappedName="queue/queue1")
       public static Queue queue;
      
       @WebMethod
       public void sendJMSMessage(String s) {
      
       ....
      
      
       }
      }


      The injection of the COnnectionFactory works fine, anyway the Queue injection issues an error when I try to access the WebService/EJB :

      Caused by: java.lang.NullPointerException
       at org.jboss.injection.lang.reflect.FieldBeanProperty.set(FieldBeanPrope
      rty.java:90)
       at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.
      java:119)
       at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.
      java:89)
       at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.
      java:61)
       at org.jboss.ejb3.injection.InjectionInvocation.invokeTarget(InjectionIn
      vocation.java:89)
       at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvo
      cation.java:83)
       at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invo
      ke(CurrentInvocationInterceptor.java:67)
       at org.jboss.ejb3.injection.InjectionInvocation.invokeNext(InjectionInvo
      cation.java:74)
       at org.jboss.ejb3.EJBContainer.injectBeanContext(EJBContainer.java:1086)
      
       at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:83)
       at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
       at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
       at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:53)
       at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:93)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles
      sInstanceInterceptor.java:58)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
      java:102)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      


      Has anybody got an idea of what could be the problem ?
      thanks a lot in advance
      marco