You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by sudhakar <su...@co.brazos.tx.us> on 2007/09/17 19:25:07 UTC
using OpenJPA with eclipse RCP plugin
I realize this is more of an eclipse related question. But was hoping
someone here has already tackled this.
I have some DAO classes that user OpenJPA. This is packaged as a jar and
I can use the jar in a regular Java application to connect and query the
database. I then created an Eclipse RCP plugin frmo this jar file. When
I launch the plugin inside an RCP application I get a
Caused by: <openjpa-1.0.0-r420667:568756 fatal user error>
org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
DataSource class name must be specified in the ConnectionDriverName
property.
at
org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:72)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:803)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:568)
Looks like OpenJPA cannot locate the persistence.xml file. Seems like
eclipse class loading issues. If someone's already figured out how to
get this to work I'd appreciate any pointers.
Thanks
Re: using OpenJPA with eclipse RCP plugin
Posted by sudhakar <su...@co.brazos.tx.us>.
Positive. The DAO classes and the persistence.xml are all packaged in a
jar file. I can use these DAO classes to query the database from a a
desktop Java application which has a dependency on this jar.
The issue is when I attempt to use the same jar as an eclipse plugin and
call the query methods. Also, I've verified the existence of
persistence.xml in the META-INF folder by unjarring the jar file.
-sud
Patrick Linskey wrote:
> Are you sure that the jar contains the right file at META-INF/persistence.xml?
>
> -Patrick
>
> On 9/17/07, sudhakar <su...@co.brazos.tx.us> wrote:
>
>> I realize this is more of an eclipse related question. But was hoping
>> someone here has already tackled this.
>>
>> I have some DAO classes that user OpenJPA. This is packaged as a jar and
>> I can use the jar in a regular Java application to connect and query the
>> database. I then created an Eclipse RCP plugin frmo this jar file. When
>> I launch the plugin inside an RCP application I get a
>>
>> Caused by: <openjpa-1.0.0-r420667:568756 fatal user error>
>> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
>> DataSource class name must be specified in the ConnectionDriverName
>> property.
>> at
>> org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:72)
>> at
>> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:803)
>> at
>> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:568)
>>
>>
>> Looks like OpenJPA cannot locate the persistence.xml file. Seems like
>> eclipse class loading issues. If someone's already figured out how to
>> get this to work I'd appreciate any pointers.
>>
>> Thanks
>>
>>
>
>
>
Re: using OpenJPA with eclipse RCP plugin
Posted by Patrick Linskey <pl...@gmail.com>.
Are you sure that the jar contains the right file at META-INF/persistence.xml?
-Patrick
On 9/17/07, sudhakar <su...@co.brazos.tx.us> wrote:
> I realize this is more of an eclipse related question. But was hoping
> someone here has already tackled this.
>
> I have some DAO classes that user OpenJPA. This is packaged as a jar and
> I can use the jar in a regular Java application to connect and query the
> database. I then created an Eclipse RCP plugin frmo this jar file. When
> I launch the plugin inside an RCP application I get a
>
> Caused by: <openjpa-1.0.0-r420667:568756 fatal user error>
> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
> DataSource class name must be specified in the ConnectionDriverName
> property.
> at
> org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:72)
> at
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:803)
> at
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:568)
>
>
> Looks like OpenJPA cannot locate the persistence.xml file. Seems like
> eclipse class loading issues. If someone's already figured out how to
> get this to work I'd appreciate any pointers.
>
> Thanks
>
--
Patrick Linskey
202 669 5907