In my experience if you don't get the jta-data-source quite right its very easy 
for openjpa to get really confused like this.  I haven't found a good way to 
clarify what's going on with it.

Two areas to look into:

1. How have you made the jdbc_dc datasource known to your app?  In geronimo 2.x 
at least this is not a jndi name, its the name of the datasource in the 
deployment plan and you need to have the datasource module listed as a 
dependency of your persistence module.

2. Are you sure the geronimo persistence deployer code is finding your 
persistence.xml and not openjpa only?  I'm not sure how to diagnose easily this 
but telling us where you put it might help.  I _think_ that if you turn logging 
up to debug then you should see something in the var/log/geronimo.log 
indicating that geronimo is processing the persistence.xml.

Also my experience is that many databases (especially derby) require a separate 
non-jta-datasource that really don't have transactions configured in order to 
get DDL and sequence values to work with openjpa.

hope this helps...
david jencks

On Jun 22, 2011, at 10:11 AM, vjay wrote:

> Hello,
> 
> I'm using Geronimo 2.2.1 and trying to setup just a tiny simple OpenJPA
> project with JTA support (container managed datasource)
> 
> this is my persistent.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="myservice" transaction-type="JTA">      
>       
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>               <jta-data-source>jdbc_dc</jta-data-source>
>               <class>com.myport.entity.Message</class>
>               <class>com.myport.entity.Accounttype</class>    
>        </persistence-unit>
> </persistence>
> 
> 
> I've tried to figure this out for a week but still struggling on the
> following error :
> 
> <openjpa-1.2.2-r422266:898935 fatal user error>
> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
> DataSource class name must be specified in the ConnectionDriverName
> property.
> 
> org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:74)
> 
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:784)
> 
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:561)
> 
> 
> I don't know why it still asking for ConnectionDriverName property since I
> attempt to put it for JTA control. Or if the datasource was incorrectly
> spelled the error message would be something else eg. "can't find datasource
> defined" or something more relevant than this..
> 
> Anyone please help...
> 
> 
> 
> --
> View this message in context: 
> http://apache-geronimo.328035.n3.nabble.com/OpenJPA-with-JTA-datasouce-problem-on-Geronimo-tp3096482p3096482.html
> Sent from the Users mailing list archive at Nabble.com.

Reply via email to