0 Replies Latest reply on May 23, 2006 1:23 PM by gurka

    Question about @EJB annotation

    gurka Newbie

      If I reference a session bean from another bean or an MDB, when deployed to JBoss 4.0.4 GA - I get a NullPointerException when it tries to deploy the MDB where the session bean is referenced. The error when JBoss starts up is:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:jar=EJB3Test.jar,name=MyMDBImpl ,service=EJB3
      State: FAILED
      Reason: java.lang.NullPointerException



      @Consumer(activationConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/test"),
      @ActivationConfigProperty(propertyName="MaxPoolSize", propertyValue="1")
      })
      public class MyMDBImpl implements MyMDB {
      @EJB MySessionBean myBean;
      public void callBeanMethod() {
      myBean.sayHello();
      }
      }

      If I take out the @EJB reference and the call to the bean's method, of course it deploys fine, as nothing really happens. Did I miss something in terms of understanding how @EJB references can be used?