[ https://issues.apache.org/jira/browse/OPENJPA-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868306#action_12868306 ]
Rajeev Chaudhary commented on OPENJPA-1653: ------------------------------------------- I resolved the issue myself. Annotation @PersistenceUnit for EntityManager work with those classes which are handled by Container.for e.g Servlet, Stateless/Sateless beans. we can also use servlet listeners. > Why getting null for EntityManagerFactory and EntityManager > ------------------------------------------------------------ > > Key: OPENJPA-1653 > URL: https://issues.apache.org/jira/browse/OPENJPA-1653 > Project: OpenJPA > Issue Type: Question > Environment: Oracle10g, weblogic10 > Reporter: Rajeev Chaudhary > > <persistence-unit name="eclepJTA"> > <jta-data-source>eclep.jpa.DataSource</jta-data-source> > <class>org.wadsworth.check.dto.FacDto</class> > </persistence-unit> > public abstract class BaseDao { > > @PersistenceUnit(unitName = "eclepJTA", name="eclepJTA") > private EntityManager entityUnit; > > @PersistenceContext(unitName = "eclepJTA", name="eclepJTA") > private EntityManager entityContext; > > @PersistenceUnit(unitName = "eclepJTA",name="eclepJTA") > private EntityManagerFactory emf; > > public void check(){ > > System.out.println("<<EntityManagerFactory:::"+emf+""+entityContext+":::wel:entityUnit::"+entityUnit); > } > All of these come as null. Could you tell me why? > I have weblogic system libraries having javax.persistence_1.0.0.0_1-0.jar and > org.apache.openjpa_2.2.0.0_1-1-0.jar. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.