persistentManager is null


EJB programming & troubleshooting: persistentManager is null

  1. persistentManager is null (1 messages)


    I have Interface which is defined as

    public interface MyPersistenceManagerLocal {

      public List getPropertyList(int id);


    and implentaion class for above interface is

    public class MyPersistenceManagerBean implements MyPersistenceManagerLocal {

      @PersistenceContext(unitName = PersistentSettings.PERSIST_NAME)
      private EntityManager entityManager;

      public List getPropertyList(int id) {
        System.out.println("inside MyPersistenceManagerBean.getPropertyList()");

    and i am calling this in another class

    public class ClientImpl implements Client {

      MyPersistenceManagerLocal persistenceManager;

      final List dbList = persistenceManager.getPropertyList(id);

     i am getting NullPointerException on
      final List dbList = persistenceManager.getPropertyList(id);
    in debug mode i got persistenceManager is null.

    i am new in EJB and JPA not able to solve this. any help why i am getting persistenceManager as null

  2. persistentManager is null[ Go to top ]

    is your persistence context properly defined in persistence.xml file and named according to your PersistentSettings.PERSIST_NAME constant value?