Hi, I've been trying to use OpenJPA like this:

                Properties props = new Properties();
                
                props.put("openjpa.RuntimeUnenhancedClasses","supported");
                props.put("openjpa.Id","DERBY-JPA");
                props.put("openjpa.ConnectionFactory", ds);
                props.put("openjpa.MetaDataFactory", 
"jpa(ClasspathScan=bin;vzk.jar)");
                props.put("openjpa.jdbc.SynchronizeMappings",
"buildSchema(ForeignKeys=true,SchemaAction=add)");

                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
property."


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

Reply via email to