You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by David Carew <dc...@gmail.com> on 2008/05/29 16:30:37 UTC
Database Pool with JPA in a Web App in G2.0.x
Does anyone know how to use a datasource with JPA classes that are in a Web
App ? If I put the database pool name in the <jta-data-source> and or
<non-jta-data-source> elements of persistence.xml I get a Naming Exception
from OpenJPA saying that the name doesn't exist in JNDI. If I put a fully
qualified JNDI name then the deployer complains because the name can't be
resolved as a database pool name. From the examples I've seen this works if
your JPA classes are in an EJB module . I don't really need to use JTA, I
just need a way to point to a database pool from my persistence.xml file.
Any ideas ?
Regards,
David
Re: Database Pool with JPA in a Web App in G2.0.x
Posted by David Carew <dc...@gmail.com>.
Correction - persistence.xml is in WEB-INF/classes/META-INF
2008/5/29 David Carew <dc...@gmail.com>:
> Hi David,
> It's in a META-INF folder in the root of the war file. Should it be
> somewhere else ?
>
> 2008/5/29 David Jencks <da...@yahoo.com>:
>
> Where is your persistence.xml? I think you are doing something so that
>> geronimo doesn't find it but openjpa does later. I think there's at least
>> one testsuite app with jpa from a web app.
>>
>> thanks
>> david jencks
>>
>>
>> On May 29, 2008, at 7:30 AM, David Carew wrote:
>>
>> Does anyone know how to use a datasource with JPA classes that are in a
>>> Web App ? If I put the database pool name in the <jta-data-source> and or
>>> <non-jta-data-source> elements of persistence.xml I get a Naming Exception
>>> from OpenJPA saying that the name doesn't exist in JNDI. If I put a fully
>>> qualified JNDI name then the deployer complains because the name can't be
>>> resolved as a database pool name. From the examples I've seen this works if
>>> your JPA classes are in an EJB module . I don't really need to use JTA, I
>>> just need a way to point to a database pool from my persistence.xml file.
>>> Any ideas ?
>>>
>>> Regards,
>>> David
>>>
>>
>>
>
Re: Database Pool with JPA in a Web App in G2.0.x
Posted by David Carew <dc...@gmail.com>.
Hi David,
It's in a META-INF folder in the root of the war file. Should it be
somewhere else ?
2008/5/29 David Jencks <da...@yahoo.com>:
> Where is your persistence.xml? I think you are doing something so that
> geronimo doesn't find it but openjpa does later. I think there's at least
> one testsuite app with jpa from a web app.
>
> thanks
> david jencks
>
>
> On May 29, 2008, at 7:30 AM, David Carew wrote:
>
> Does anyone know how to use a datasource with JPA classes that are in a
>> Web App ? If I put the database pool name in the <jta-data-source> and or
>> <non-jta-data-source> elements of persistence.xml I get a Naming Exception
>> from OpenJPA saying that the name doesn't exist in JNDI. If I put a fully
>> qualified JNDI name then the deployer complains because the name can't be
>> resolved as a database pool name. From the examples I've seen this works if
>> your JPA classes are in an EJB module . I don't really need to use JTA, I
>> just need a way to point to a database pool from my persistence.xml file.
>> Any ideas ?
>>
>> Regards,
>> David
>>
>
>
Re: Database Pool with JPA in a Web App in G2.0.x
Posted by David Jencks <da...@yahoo.com>.
Where is your persistence.xml? I think you are doing something so
that geronimo doesn't find it but openjpa does later. I think there's
at least one testsuite app with jpa from a web app.
thanks
david jencks
On May 29, 2008, at 7:30 AM, David Carew wrote:
> Does anyone know how to use a datasource with JPA classes that are
> in a Web App ? If I put the database pool name in the <jta-data-
> source> and or <non-jta-data-source> elements of persistence.xml I
> get a Naming Exception from OpenJPA saying that the name doesn't
> exist in JNDI. If I put a fully qualified JNDI name then the
> deployer complains because the name can't be resolved as a database
> pool name. From the examples I've seen this works if your JPA
> classes are in an EJB module . I don't really need to use JTA, I
> just need a way to point to a database pool from my persistence.xml
> file. Any ideas ?
>
> Regards,
> David