Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 89961 invoked from network); 5 Sep 2007 06:14:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2007 06:14:25 -0000 Received: (qmail 84470 invoked by uid 500); 5 Sep 2007 06:14:18 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 84446 invoked by uid 500); 5 Sep 2007 06:14:18 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 84435 invoked by uid 99); 5 Sep 2007 06:14:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 23:14:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.147.95.74] (HELO smtp111.plus.mail.sp1.yahoo.com) (69.147.95.74) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 05 Sep 2007 06:14:14 +0000 Received: (qmail 68040 invoked from network); 5 Sep 2007 06:13:54 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=rTRWTASqY2vG/OkM5lZIVMatG2CXf1sVy0qExhxD0FeJwLBqq1AjemGFnRehtFqkT6T7Z7s033wvaLCAKBy/pFzxcha62G2sJ4cAokcm9Ta2Z9P3OpkfMKdVoLyWIGx2B5XWiysciqyIX7ptRHvauqz2BCabDO+IhiV9p60DwEA= ; Received: from unknown (HELO ?192.168.1.106?) (david_jencks@67.102.173.8 with plain) by smtp111.plus.mail.sp1.yahoo.com with SMTP; 5 Sep 2007 06:13:53 -0000 X-YMail-OSG: b_GU4w4VM1mcFgc2kOCZXIqLzzrcIlsngDR8CNvolFAXk78GgV13uPH4eqkoVsnryePn11S9lWIj2HOdSd_gBwxND3K8zXXGiTrUsbWDRFRy7yW0IuOLEEbOhGD0 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <8594.45564.qm@web27708.mail.ukl.yahoo.com> References: <8594.45564.qm@web27708.mail.ukl.yahoo.com> Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: David Jencks Subject: Re: Geronimo 2.0.1 and entity bean problem Date: Tue, 4 Sep 2007 23:13:48 -0700 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org There's a really simple jpa sample in the testsuite. If you check =20 out the geronimo source it will be under testsuite/enterprise-testsuite/jpa-tests/ Hope this helps david jencks On Sep 4, 2007, at 5:08 PM, Xh wrote: > Hi All! > > I'm trying to create my first ejb3 entity bean in Geronimo 2.0.1. > > I base on this wiki: > http://cwiki.apache.org/GMOxDOC20/very-simple-entity-ejb-example.html > > I've created simple WebModule and annoted it, just like this: > > @Entity > @Table(name=3D"dw_module",schema=3D"dw") > public class WebModule implements Serializable { > ... > } > > Acording to the above wiki openejb-jar.xml is only to define module =20= > and artifactId, so do mine. > In addition, I have META-INF/persistance.xml that looks like this: > > > > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =20 > version=3D"1.0" > xsi:schemaLocation=3D"http://java.sun.com/xml/ns/persistence =20 > http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> > > > org.apache.openjpa.persistence.PersistenceProviderImpl > > org.xh.dataweaver2.web.entity.WebModule > > value=3D"jdbc:derby:target/dataweaver" /> > > value=3D"admin123" /> > value=3D"org.apache.derby.jdbc.EmbeddedDriver" /> > > > > > > Later on, in my Servlet I have: > > // thread-safe, class level context > @PersistenceContext(unitName =3D "WebModulePU", name =3D = "persistence/em") > public class DispatcherServlet extends HttpServlet implements =20 > Servlet { > ... > EntityManager em =3D null; > try { > em =3D (EntityManager) (new InitialContext()) > .lookup("java:comp/env/persistence/em"); > } catch (NamingException e) { > e.printStackTrace(); > } > ... > } > > > The thing is that my application deploys and starts without any =20 > errors. > But I cannot see my entity bean in the JNDI Viewer; > as a result, when I access my Servlet I keep getting: > javax.naming.NotContextException: persistence/em > > Can some one provide an example of working entity bean and its =20 > persistance.xml? > > thanks and best regards > =C5=81ukasz > > > > > =09 > =09 > =09 > ___________________________________________________________ > Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide =20 > with voicemail http://uk.messenger.yahoo.com