From dev-return-16476-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Mon May 17 17:44:05 2010 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 30481 invoked from network); 17 May 2010 17:44:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 May 2010 17:44:04 -0000 Received: (qmail 99992 invoked by uid 500); 17 May 2010 17:44:04 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 99969 invoked by uid 500); 17 May 2010 17:44:04 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 99961 invoked by uid 99); 17 May 2010 17:44:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 17:44:04 +0000 X-ASF-Spam-Status: No, hits=-1435.1 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 17:44:03 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4HHhhh6021977 for ; Mon, 17 May 2010 17:43:43 GMT Message-ID: <7423830.87341274118223071.JavaMail.jira@thor> Date: Mon, 17 May 2010 13:43:43 -0400 (EDT) From: "Rajeev Chaudhary (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1653) Why getting null for EntityManagerFactory and EntityManager In-Reply-To: <31262907.28241273087502219.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 > > > eclep.jpa.DataSource > org.wadsworth.check.dto.FacDto > > 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("< } > 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.