2 Replies Latest reply on Feb 3, 2007 10:45 AM by piotr.walczyszyn

    EntityManager injection in Authenticator class

    piotr.walczyszyn

      I have a problem with injection of EntityManager in my Authenticator class. When I login my EntityManager variable is null and I get NPE. In my environment I'm using jboss-4.0.5 and JSF 1.2 RI. I'm wondering if my authenticator class shouldn't be SFSB or SLSB in this case?

      Here is part of my Authenticator class:

      @Name("authenticator")
      public class Authenticator {
      
       @Logger
       Log log;
      
       @Out(required = false, scope = SESSION)
       private User user;
      
       @PersistenceContext
       private EntityManager em;
      
       public boolean authenticate(String username, String password,
       Set<String> roles) {