From open-jpa-dev-return-4128-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Wed May 16 20:30:46 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 41363 invoked from network); 16 May 2007 20:30:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 May 2007 20:30:46 -0000 Received: (qmail 39978 invoked by uid 500); 16 May 2007 20:30:51 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 39941 invoked by uid 500); 16 May 2007 20:30:51 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 39932 invoked by uid 99); 16 May 2007 20:30:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 13:30:51 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of plinskey@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 13:30:42 -0700 Received: by py-out-1112.google.com with SMTP id p76so652992pyb for ; Wed, 16 May 2007 13:30:21 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ILFWO95AedCnYAP/TEeaKfZWyITeFH4INpWa57nwiB955epa52Ak/u3wslKmlXFey/k9NsdHFMzVEE/ikcTMpCZx9cSU7XHc+rOe0cdbZZgpCo91MyMvcPkwxNZ7bCSKvWOU7UkPz0M0HH/ZrZIQ+yIIUE/ZQxU1LmVDSux2RKQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jgXkkNVj/GYqLHz8jtJGJvOOG9rDhMBJzYQCDOi0m370VDP36Q0H4FAosGBEHn1VwxQ7L6DTvZNblXH/FlzcdVaDgdAt2AD3eFqb1r4MdKBZcueYaq8A/GEiUBGjdY05nGkWXyRRwsp3B5QFvLha8KJFD3u9iZvBk9igwnpBSZQ= Received: by 10.35.94.2 with SMTP id w2mr15607432pyl.1179347418296; Wed, 16 May 2007 13:30:18 -0700 (PDT) Received: by 10.35.8.4 with HTTP; Wed, 16 May 2007 13:30:18 -0700 (PDT) Message-ID: <7262f25e0705161330l7e5112f2v66e843c44d85b827@mail.gmail.com> Date: Wed, 16 May 2007 13:30:18 -0700 From: "Patrick Linskey" To: open-jpa-dev@incubator.apache.org, Murali Subject: Re: JNDI lookup in OpenJPA. In-Reply-To: <003201c796ae$0ec27790$779a020a@emagiahyd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <002001c79483$586996d0$779a020a@emagiahyd.com> <7D856CDFE035FF45A0420ACBD71BDD63041DE8A3@repbex02.amer.bea.com> <003201c796ae$0ec27790$779a020a@emagiahyd.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Are you writing this in an EJB, or some other artifact type? -Patrick On 5/14/07, Murali wrote: > Hi, > > I am new to OpenJPA technology. > > I am having problems while performing JNDI lookup for the bean resources to get the EntityManagerFactory instance. > > I am trying to perform JNDI lookup operation to fetch the DataSource & EntityManagerFactory instances to connect to the DataBase. > > Following is the code snippet: > > public static EntityManagerFactory getOpenJPASessionFactory(String jndiSessionFactoryName) throws DaoException { > EntityManagerFactory emFactory = null; > try { > Context ctx = new InitialContext(); > emFactory = (EntityManagerFactory) ctx.lookup(jndiSessionFactoryName); > }catch (ClassCastException cce) { > throw new DaoException(DaoConstants.OPENJPA_FACTORY_ERROR, cce); > } catch (NamingException ne) { > throw new DaoException(DaoConstants.OPENJPA_FACTORY_ERROR, ne); > } > return emFactory; > } > > When i try to get the EntityManager Instance from Factory instance, it says "jndiSessionFactoryName" is not bound, because of this i am not able to get the Datasource for performing the Database operations. > > Following are the environment details: > > Application Server: Jboss-4.0.4.GA > Operating System with version: Redhat Linux 4, with kernel version 2.6.9.42 Elsmp > OpenJPA version: 0.9.7 > JDK version: Jdk 1.5.0_07 > Database: IBM DB2 version 9.1 > > Is there any interoperability issue of OpenJPA with Jboss-4.0.4.GA? > Do we have to upgrade to any newer version of Jboss ? > > Please help me in this regard. > > Thanks in advance. > > Waiting for your response. > > Regards, > Murali Krishna Adiraju. > -- Patrick Linskey 202 669 5907