-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate as alternative persistence provider for WAS7
PostPosted: Thu Sep 09, 2010 7:22 am 
Newbie

Joined: Thu Sep 09, 2010 7:13 am
Posts: 1
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.html
http://www.ibm.com/developerworks/websp ... #hibernate

My 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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.