8 Replies Latest reply on Nov 10, 2006 9:22 AM by Joseph Nusairat

    EntityManager always Null (Using Jboss,Seam)

    lara khoury Newbie

      I have a method in a class and inside that method I am trying to access the database by using the EntiyManager. I declared the following:
      private EntityManager entityManager;
      I am always getting a NullPointerException when I try printing the value entityManager inside the method, I mean that the value is null for entityManager.
      In this class, no annotations are specified whether stateful or stateless, no scope is specified. Does this matter to access the EntityManager? I made sure of the persistence.xml and it is correct. So what could the problem be? It seems the injection is not working. Any help would be highly appreciated. Thanks in advance!