Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 32708 invoked from network); 13 Feb 2010 18:00:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Feb 2010 18:00:55 -0000 Received: (qmail 83307 invoked by uid 500); 13 Feb 2010 18:00:54 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 83227 invoked by uid 500); 13 Feb 2010 18:00:54 -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 83219 invoked by uid 99); 13 Feb 2010 18:00:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Feb 2010 18:00:54 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [69.147.102.65] (HELO smtp102.plus.mail.re1.yahoo.com) (69.147.102.65) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 13 Feb 2010 18:00:44 +0000 Received: (qmail 49646 invoked from network); 13 Feb 2010 18:00:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.gr; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=pXJqLrpTDNVY4hojYdW9PeCOY9WVaVKTmLhV789gSI4mx7YfoGKE3oDwGGOvQ9SOT55qvAZzgNcb19rnzuPUB5OA4p/eix1A2apSvvzQ4C+cYiOcPBGgvxrOcGSMgsDDa2uFXEjfHhUep3IVCyCXhJ/XwqsLhVx0rKpEt57AK3k= ; Received: from cust-87-227.on4.ontelecoms.gr (akarypid@92.118.87.227 with plain) by smtp102.plus.mail.re1.yahoo.com with SMTP; 13 Feb 2010 10:00:21 -0800 PST X-Yahoo-SMTP: zqOro8aswBATGnFGyBkfgkPClVMj X-YMail-OSG: J091FNAVM1m7QmHefSPHaWHun4DBm_v6Hqv2JsZB6tTJLBBTfclKYAUiWwKm_Qhai2kgQgrfD6HfgLGrTGsh.jC6M6aQ8LRqSMgTRNyDhHNWRso0Ke42WvIHj4kWqOUJCvw.96jFDrLvCuFO.QmtMuB6YOhiyIIxabqyVvwWUatFCmp3hKasBmf8tOg9wSjhI1kGJMyQ9j6.8cGkgL5YoVYbK.VHUeoSc4M1Ovpb.kJ3thsMC1fuqtpDAxuOJosiAIhyZRXUEBE8OjBUhN4EaaLms3o42PwKm6P9CGhq9b_i.WazyIKznVC9bJiWFHSQhZ2ER.aGAlS.CfD9TXhfbVz8DRhAAgJdp6NPFF81IhJYjzvhKNojC.uEJqIdPcUHtxBUlwEl93BYyOlCDGEJ8yZzu4FZnZw.AN93ijo- X-Yahoo-Newman-Property: ymail-3 Message-ID: <4B76E8B8.9070404@yahoo.gr> Date: Sat, 13 Feb 2010 20:00:24 +0200 From: Alexandros Karypidis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1 MIME-Version: 1.0 To: user@geronimo.apache.org Subject: Re: Container-managed JPA in pure WAR with JNDI References: <533342.13611.qm@web28604.mail.ukl.yahoo.com> <783C7877-CEF2-451C-8437-F70E7145A52A@yahoo.com> In-Reply-To: <783C7877-CEF2-451C-8437-F70E7145A52A@yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello David, Thanks for helping out. Following yout e-mail: 1) I've fixed the problem by using "SystemDatasource" (not SystemDatabse) as the name. 2) I don't really care whether Geronimo uses JNDI or not internally. I need to register the JPA persistence context in my web application's JNDI context, as I am using Spring which expects to be able to look it up via JNDI (using if you're familiar with Spring). So I need the reference in web.xml for my own purposes. Anyway, it works now so this has been resolved. 3) I don't really intend to use Derby; I was just taking things step-by-step. Having said that, how do I define my own datasource in Geronimo? For example, in JBoss you use a "somename-ds.xml" file to register a datasource. On 12/2/2010 8:20 μμ, David Jencks wrote: > Geronimo doesn't use jndi for the datasources in persistence.xml. You > don't need to configure resource-refs for the datasources. You do > need to make sure they are in ancestor plugins to the app and that you > use the name from the datasource configuration. In this case I think > that would be > SystemDatabase > > In my experience, at least with derby, you need both jta and non-jta > datasource. I guess if you aren't using jta transactions at all you > might be able to use just a non-jta-data-source, but I haven't tried > this. > > thanks > david jencks > > On Feb 12, 2010, at 6:53 AM, Alexandros Karypidis wrote: > >> Hello, >> >> My scenario is this: >> >> I have a library with entities (as in @Entity objects) containing my >> domain model. I want to declare a container-managed persistence unit >> in a standalone WAR (not EAR), using that library (the >> persistence.xml must NOT be in the library, but the WAR). So, I >> proceed as follows (this is valid as far as I know, base on J2EE5 >> specs): >> >> 1) I have declared a data source in geronimo-web.xml and web.xml (see >> below for file contents). >> 2) I put my library (as a jar) in my WAR's WEB-INF/lib and added a >> WEB-INF/classes/META-INF/persistence.xml in the WAR (see below for >> file contents). >> >> Deployment after performing step (1) worked and I could see the data >> source registered in the console. >> >> Deployment after performing step (2) fails; from what I understand >> from the error (see below), geronimo claims the data-source from step >> (1) does not exist. I assume that geronimo tries to create the >> persistence context prior to registering the data source? (i.e. it >> processes persistence.xml prior to apply the configuration from >> web.xml and geronimo-web.xml). >> >> What do I need to configure this properly. My deployment descriptors >> and the error trace follow: >> >> persistence.xml >> ------------------------------------------------------------------------------------------------------------------------------------------------- >> >> >> > xmlns="http://java.sun.com/xml/ns/persistence" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation=" >> http://java.sun.com/xml/ns/persistence >> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" >> version="1.0"> >> >> jdbc/AppDataSource >> app-entities.jar >> >> >> >> >> web.xml >> ------------------------------------------------------------------------------------------------------------------------------------------------- >> >> >> > xmlns="http://java.sun.com/xml/ns/j2ee" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation=" >> http://java.sun.com/xml/ns/j2ee >> http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd" >> version="2.4"> >> >> App >> >> >> >> >> jdbc/AppDataSource >> javax.sql.DataSource >> Container >> Shareable >> >> >> >> >> >> geronimo-web.xml >> ------------------------------------------------------------------------------------------------------------------------------------------------- >> >> >> > xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" >> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" >> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> >> >> >> >> app >> app-frontend >> 0.0.1 >> car >> >> >> >> >> org.apache.geronimo.configs >> >> system-database >> >> >> >> >> >> /app >> >> >> >> >> jdbc/AppDataSource >> SystemDatasource >> >> >> >> __________________________________________________ >> Χρησιμοποιείτε Yahoo!; >> Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει >> την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων >> http://mail.yahoo.gr >