openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brill Pappin" <br...@pappin.ca>
Subject Help - following the docs but just can't get it to work
Date Fri, 26 Oct 2007 06:02:02 GMT
I can't wait to use this library... it's simplicity is exciting...
However I just can't seem to get it to work.
 
I just keep getting an exception:
<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(DataSourceFac
tory.java:72)
 at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(J
DBCConfigurationImpl.java:803)
 at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(J
DBCConfigurationImpl.java:568)
 at
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepos
itory.java:1221)
 at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.
java:467)
 at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.
java:392)
 at
org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:102)
 at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:82)
 at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstan
ce(OpenJPAConfigurationImpl.java:857)
 at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstan
ce(OpenJPAConfigurationImpl.java:852)
 at
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerF
actory.java:628)
 at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFact
ory.java:169)
 at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBroker
Factory.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)
[...]
 
As far as I can tell after reading the documention, i've got the config
properly set up as:
 
META-INF/persistence.xml
 
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
 <persistence-unit name="lobbythem">
  <transaction-type>JTA</transaction-type>
  <provider>
   org.apache.openjpa.persistence.PersistenceProviderImpl
  </provider>
  <class>...</class>
  ... <= all the classes here.
  <properties>
   <property name="openjpa.jdbc.DBDictionary" value="mysql" />
   <property name="openjpa.ConnectionURL"
    value="jdbc:mysql://<standard jdbc url>" />
   <property name="openjpa.ConnectionDriverName"
    value="com.mysql.jdbc.Driver" />
   <property name="openjpa.ConnectionUserName" value="<username>" />
   <property name="openjpa.ConnectionPassword" value="<password>" />
   <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO" />
  </properties>
 </persistence-unit>
</persistence>
 
 
I've also tried:
- removing the "openjpa." in the property names.
- using the openjpa.xml instead.
 
In case it helps, all the tools give the same error. the stop complaining
when I specify the property names on the command line (havn't actually got
them to work but thats a different problem).
Also, I'm a Maven 2 user, so my classes are in src/main/java and my
resources are in src/main/resources and the openjpa-maven-plugin gives the
same error (so its not liking the config as well).
 
does anyone have any idea what the heck is going on?
 
- Brill Pappin
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message