JPA errors


I am trying to connect to a DS using JPA , i am getting the below exception. When i connect using the same DB connection string in a standalone program i am able to get it.  But thru JPA it wont work, i am attaching my persisitance.xml too.  I am trying to run this in tomcat and Eclipse JUNO

type Exception report
message There were errors initializing your configuration: <openjpa-2.1.1-r422266:1148538 fatal user error> org.apache.openjpa.util.UserException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
description The server encountered an internal error that prevented it from fulfilling this request.
<openjpa-2.1.1-r422266:1148538 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: <openjpa-2.1.1-r422266:1148538 fatal user error> org.apache.openjpa.util.UserException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
        at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(
        at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(
        at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(
        at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You need to add more information in your persistence XML, the jdbc driver, the url of the database, username/password, etc.

Have a look at a sample persistence.xml.
Jim CakalicSenior Developer/ArchitectCommented:
The OpenJPA documentation for the 2.1.1 release is here:

An example configuration given in that document is:
<?xml version="1.0"?>
<persistence version="1.0">
<persistence-unit name="openjpa">
<property name="openjpa.ConnectionURL" value="jdbc:hsqldb:tutorial_database"/>
<property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/>
<property name="openjpa.ConnectionUserName" value="sa"/>
<property name="openjpa.ConnectionPassword" value=""/>
<property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>

Open in new window

The error you are getting is stating that you have not provided a ConnectionDriverName property with the fully-qualified class name of the JDBC driver to use for this persistence unit. The driver, url, user and password are all required properties. Chapter 2 of the document describes numerous other properties that may be of value to you as you proceed.

Jim Cakalic

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.