openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanislav Paskalev <>
Subject Using OpenJPA 2.0.0 with a JNDI-bound DataSource ?
Date Sat, 17 Jul 2010 15:18:56 GMT
Hi, I've been trying to use OpenJPA like this:

		Properties props = new Properties();
		props.put("openjpa.ConnectionFactory", ds);
		props.put("openjpa.MetaDataFactory", "jpa(ClasspathScan=bin;vzk.jar)");

		entityManagerFactory =
Persistence.createEntityManagerFactory("openjpa", props);

Where "ds" is a tomcat provided instance of a Derby datasource and
it's not null. This fails with "<openjpa-2.0.0-r422266:935683 fatal
general error> org.apache.openjpa.persistence.PersistenceException:
Cannot create JDBC driver of class '' for connect URL 'null'"

When I replace the openjpa.ConnectionFactory with this:
		props.put("openjpa.ConnectionFactoryName", "jdbc/DERBYDS");

I'm getting "<openjpa-2.0.0-r422266:935683 fatal user error>
org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or
DataSource class name must be specified in the ConnectionDriverName

I DO NOT want to explicitly  use the jdbc driver and url (it works
this way atleast :)). Any hints what am I missing here will be greatly
appreciated! :)

Best regards,
Stanislav Paskalev

View raw message