-->
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.  [ 2 posts ] 
Author Message
 Post subject: NPE at JtaStatusHelper.getStatus
PostPosted: Wed Feb 03, 2016 12:39 pm 
Newbie

Joined: Wed Jan 06, 2016 4:35 pm
Posts: 5
I keep getting this error when trying to create a query. Have seen similar threads, but I think my setup looks correct. Any suggestions?

EJB Exception: : java.lang.NullPointerException
at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)
at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)
at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1602)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:210)
at org.hibernate.jpa.internal.EntityManagerImpl.<init>(EntityManagerImpl.java:91)
at org.hibernate.jpa.internal.EntityManagerFactoryImpl.internalCreateEntityManager(EntityManagerFactoryImpl.java:345)
at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:313)
at weblogic.persistence.PersistenceContextWrapper.<init>(PersistenceContextWrapper.java:23)
at weblogic.persistence.TransactionalEntityManagerProxyImpl.newPersistenceContext(TransactionalEntityManagerProxyImpl.java:123)
at weblogic.persistence.TransactionalEntityManagerProxyImpl.getPersistenceContext(TransactionalEntityManagerProxyImpl.java:103)
at weblogic.persistence.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:105)
at weblogic.persistence.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:138)
at weblogic.persistence.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:91)
----------------------------------------
Environment - Weblogic 12.1.3, Hibernate 4.3.11. My persistence file looks like this:

<persistence-unit name="HIF-BannerPU" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/HIF-Banner</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<class>com.hsntech.hif.entity.Uctvmstr</class>
<class>com.hsntech.hif.entity.Uctvvals</class>
<properties>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WeblogicJtaPlatform" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
</properties>
</persistence-unit>
---------------------------------------------------------------------
@Stateless
public class Testeaoimpl implements Testeao {
@PersistenceContext(unitName = "HIF-BannerPU")
private EntityManager em;
// *** exception thrown here
Query qry = em.createQuery("select m from Uctvmstr m");


Top
 Profile  
 
 Post subject: Re: NPE at JtaStatusHelper.getStatus
PostPosted: Thu Feb 04, 2016 3:14 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
I think you're getting that exception because Hibernate cannot locate the TM.

The configuration looks ok, so the only problem might be if your Weblogic doesn't expose the Transaction Manager under this JNDI name:

Code:
javax.transaction.TransactionManager


If that's so, you need to extend the default WeblogicJtaPlatform, override the methods that locate the TM and the UT and supply the new platform as a configuration proeprty.


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

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.