2 Replies Latest reply on Jun 8, 2007 5:41 AM by moshe1

    SMPC in a SFSB throws a nullpointer

    moshe1

      When injecting the Seam Managed Persistence Context in a Stateful Session bean, it does not get injected and subsequent references to the entityManager throws a NullPointer Exception.


      The below code demonstrated the problem, When @Stateful is removed everything works fine.


      @Name("forward")
      @Scope(value=ScopeType.CONVERSATION)
      @Stateful
      public class Forward implements ForwardLocal{
      @In
      private EntityManager em;
      
       List<User> users;
      
      
      @Create
      public void init() {
      users= em.createQuery(" from User as u").getResultList();
      
      }