EntityManager is null inside Pojo class in ejb container
问题 I have a Java web service module and ejb modulein netbeans (All part of an enterprise application). the web service is consuming the ejb class using @EJB injection. Inside the ejb module i have a TransactionManager class which is not an enterprise bean. just a POJO class. I am trying to inject the EntityManager using @PersistanceContext(unitName = "testPU") EntityManager em; but the em is allways null. I am calling the TransactionManager class from by bean, and if i declare the EntityManager