Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Possible reasons for Persistence.createEntityManagerFactory
returning null

KK

2008-08-13

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi,
I am creating a stand alone java program with OpenJPA. I have placed my
persistence.xml in bin\META-INF\. But when I do
Persistence.createEntityManagerFactory, it is returning null. When I used
the same folder structure with Toplink JPA, it is working fine.

The method is just returning null and there is no exception which can
indicate the possible reasons. Please tell me what can be the possible
reasons for the Persistence.createEntityManagerFactory("persistence-unit
name") method to return null.

Regards,
KK

My persistence.xml is as given below:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
 <persistence-unit name="ibm" transaction-type="RESOURCE_LOCAL">
   <provider>
     org.apache.openjpa.persistence.PersistenceProviderImpl
   </provider>
   <mapping-file>mapping/orm.xml</mapping-file>
   <class>com.entity.Customer</class>
   <class>com.entity.Organization</class>
   <class>com.BillingAddress</class>
   <properties>
     <property name="openjpa.Log"
       value="DefaultLevel=WARN, Tool=INFO" />
     <property name="openjpa.ConnectionURL"
       value="jdbc:mysql://localhost:3306/wdp_jpa" />
     <property name="openjpa.ConnectionUserName" value="root" />
     <property name="openjpa.ConnectionDriverName"
       value="com.mysql.jdbc.Driver" />
     <property name="openjpa.ConnectionPassword" value="admin" />
     <property name="openjpa.jdbc.SynchronizeMappings"
       value="buildSchema(SchemaAction=add,deleteTableContents)" />
   </properties>

 </persistence-unit>
</persistence>

--
Sent from the OpenJPA Users mailing list archive at Nabble.com.

©2008 gg3721.com - Jax Systems, LLC, U.S.A.