-->
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: WebSphere 7 Hibernate 4.2 EntityManager inject fails
PostPosted: Mon Nov 11, 2013 11:06 am 
Newbie

Joined: Mon Nov 11, 2013 8:53 am
Posts: 1
We use WebSphere Transaction Management and would like to associate an EntityManager with every Transaction via WebSphere.
Unfortunately, WebSphere does not inject the EntityManager.

The only log it writes is:
Code:
[11.11.13 14:46:22:730 CET] 0000000f JPAPUnitInfo  E   CWWJP0009E:
Der Server kann keine EntityManagerFactory-Factory für die persistente Einheit AVAM_PERSISTENCE_UNIT aus dem Provider org.hibernate.ejb.HibernatePersistence
im Modul file:/C:/projects/clearcase/X60005065_view_cr_1134_Hibernate/AVAM-NEU-sources-VOB/AVAM-RSA/AVAM_Common/compiledClasses/ erstellen.


In the Code an EntityManger can be instantiated and used without further problems with
entityManagerFactory = javax.persistence.Persistence.createEntityManagerFactory("AVAM_PERSISTENCE_UNIT");

I wonder if anybody else uses WebShere 7 and Hibernate 4 and knows what the problem might be.

Code to inject:
Code:
@PersistenceContext(unitName="AVAM_PERSISTENCE_UNIT", type=PersistenceContextType.TRANSACTION)
   EntityManager entityManager;


persistence.xml
Code:
<persistence-unit name="AVAM_PERSISTENCE_UNIT" transaction-type="JTA">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>jdbc/dsAVAM</jta-data-source>
      <class>ch.admin.bit.avam.administration.model.Code</class>
      <properties>
         <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform" />
         <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory" />
         <property name="hibernate.session_factory_name" value="java:hibernate/SessionFactory" />
         <property name="jta.UserTransaction" value="java:comp/UserTransaction"/>
         <property name="current_session_context_class"     value="jta" />   <!-- jta, thread, managed, or custom.Class -->
                          ...


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.