1 Reply Latest reply on Sep 7, 2007 5:32 AM by Pete Muir

    EntityManager is null when Stateless Session Bean invoked fr

    jfrankman Novice

      Is it possible to inject the EntityManager into a stateless session bean if the bean is invoked from a MDB?

      I have a message driven been that calls a stateless session bean. In the session bean I inject entity manager. But when the session bean is invoked from the MDB the entity manager is always null. The app is deployed as an EAR and everything deployes successfully.

      MDB:

      @MessageDriven(activationConfig =
      {
       @ActivationConfigProperty(propertyName="destinationType",
       propertyValue="javax.jms.Queue"),
       @ActivationConfigProperty(propertyName="destination",
       propertyValue="queue/KeyCheckImageQueue2")
      })
      
      public class KeyCheckImagesMessageHandler implements MessageListener{
      
       public void onMessage (Message msg) {


      Stateless session bean:
      @Stateless
      @Name("xyzServices")
      public class KeyServicesImpl implements KeyServices
      {
      
       @PersistenceContext
       private EntityManager em;