geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Tedeev <ted_...@hotmail.com>
Subject Re: Problem with persistence.xml (how to use data source?)
Date Sun, 30 Mar 2008 21:37:03 GMT

oops. It was deploying only because I accidentally put it into WEB-INF
instead of META-INF.
So persistence unit was not just found. As soon as i put it in right place
META-INF/persistence.xml
it will produce same error. Also my other advise above to put the whole jpa
persistence module into 
geronimo-web.xml will not work either if you try to use referenced names in
jta/non-jta datasource.
Though since the persistence unit is declared itself in geronimo-web.xml you
can just refer to real jdbc pooll names and deploy differently pointed
persistence units for different clients.

Hope it helps.

There is another issue though that another deployment error arise if you try
to use in geronimo-web.xml both : security and persistence. Though if you
don't use geronimo security it will work. You can refer about this problem
in thread :

http://www.nabble.com/complex-geronimo-web.xml-problem-td16379211s134.html


Andrey Tedeev wrote:
> 
> Worked for me (at least application deploys)
> 
> WEB-INF/persistence.xml ---------------------------------
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="1.0" 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">
>   <persistence-unit name="equipment-pu">
>    
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>     <jta-data-source>jdbc-jta-ds</jta-data-source>
>         <non-jta-data-source>jdbc-non-jta-ds</non-jta-data-source>
>     <!-- ssi.api.jpa.company -->
>     <class>ssi.api.jpa.company.Description</class>
>     <class>ssi.api.jpa.company.Equipment</class>
>     <class>ssi.api.jpa.company.EquipmentMaintanence</class>
>     <class>ssi.api.jpa.company.EquipmentMaintanenceType</class>
>     <class>ssi.api.jpa.company.EquipmentType</class>
>     <properties>
>       <property name="openjpa.Log" value="DefaultLevel=TRACE, Tool=TRACE,
> SQL=INFO"/>
>       <property name="openjpa.jdbc.DBDictionary"
> value="ssi.api.jpa.AS400Dictionary"/>
>     </properties>
>   </persistence-unit>
> </persistence>
> 
> 
> Then in geronimo-web.xml I have these references :
> 
> <nam:resource-ref
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
>         <nam:ref-name>jdbc-jta-ds</nam:ref-name>
>         <nam:resource-link>jdbc-jta-AAF</nam:resource-link>
> </nam:resource-ref>
> 
> <nam:resource-ref
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
>         <nam:ref-name>jdbc-non-jta-ds</nam:ref-name>
>         <nam:resource-link>jdbc-non-jta-AAF</nam:resource-link>
> </nam:resource-ref> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-persistence.xml-%28how-to-use-data-source-%29-tp16380414s134p16387790.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message