Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA error: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName prop

 
Mark Manns
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I'm trying to use openjpa 1.1 in weblogic ( it comes with weblogic 10) but I keep getting the error:

Caused by: <openjpa-1.1.0-r422266:657916 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:776)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:553)
at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1250)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:430)
at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103)
at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:843)
at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:834)
at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:638)
at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
at com.ets.domain.messagecustom.MessageCustomDao.<init>(MessageCustomDao.java:22)

line 22 in MessageCustomDao is:

// MessageCustomJPAPersistenceUnit is defined in the persistence.xml
emf = Persistence.createEntityManagerFactory("MessageCustomJPAPersistenceUnit");
em = emf.createEntityManager(); // LINE 22

my persistence.xml looks like:

<?xml version="1.0"?>
<persistence>
<persistence-unit name="MessageCustomJPAPersistenceUnit"
transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<class>com.Class1</class>
<class>com.Class2</class>
<class>com.Class3</class>
<jta-data-source>jdbc/JPADataSource</jta-data-source>
<properties>
<property name="openjpa.ConnectionDriverName" value="oracle.jdbc.OracleDriver" />
</properties>
</persistence-unit>
</persistence>

and the JPADataSource is a tested DataSource targeted to my weblogic server instance and tests green.

can anyone tell me what the problem is - this is my first attempt at using a JPA implemenation? is my persistence.xml incorrect? am i not creating the entity manager factory or entity manager correctly?

Any help would be appreciated.

Mark
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic