I am using a WAS7 with a DB2 and I want to change the persistence provider from openjpa 1.2.2 (provided with WAS7) to hibernate 3.3.2.GA (the last JPA 1.0 implementation?).
But it doesnt work, I get following error:
Code:
Caused by: javax.ejb.EJBTransactionRolledbackException: nested exception is: javax.ejb.EJBException: Injection failure; nested exception is: java.lang.IllegalStateException: EntityManagerFactory has not been created for PU : PuId=ZWREar#ZWRService.jar#zwr+
Caused by: javax.ejb.EJBException: Injection failure; nested exception is: java.lang.IllegalStateException: EntityManagerFactory has not been created for PU : PuId=ZWREar#ZWRService.jar#zwr+
Caused by: java.lang.IllegalStateException: EntityManagerFactory has not been created for PU : PuId=ZWREar#ZWRService.jar#zwr
at com.ibm.ws.jpa.management.JPAPUnitInfo.getEntityManagerFactory(JPAPUnitInfo.java:1352)
I can't make head or tail of it:
http://publib.boulder.ibm.com/infocente ... party.htmlhttp://www.ibm.com/developerworks/websp ... #hibernateMy persistence.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="asdf" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/asdf</jta-data-source>
<class>at.gv.domain.impl.ClassA</class>
<class>at.gv.domain.impl.ClassB</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.connection.datasource" value="
java:/comp/env/jdbc/asdf" />
<property name="hibernate.transaction.factory_class"
value="org.hibernate.transaction.CMTTransactionFactory" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" />
</properties>
</persistence-unit>
</persistence>
Do I need really to declare a jta-data-source
and a property with a datasource?
Quote:
<jta-data-source>jdbc/asdf</jta-data-source>
Code:
<property name="hibernate.connection.datasource" value="
java:/comp/env/jdbc/asdf" />
Could someone tell me what I have to do that an alternative persistence provider works?