NullPointerException starting JTA transaction from Spring code in JBoss EAP
Issue
NullPointerExceptionwhen Spring attempts to start a transaction
java.lang.NullPointerException
at org.hibernate.engine.transaction.internal.jta.JtaTransaction.getJoinStatus(JtaTransaction.java:274)
at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.attemptToRegisterJtaSync(TransactionCoordinatorImpl.java:222)
...
at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:174)
at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:400)
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:321)
...
- Hibernate configuration was created as below
...
<persistence-unit name="MyPersistenceUnit" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/MyDS</jta-data-source>
...
<properties>
...
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandaloneJtaPlatform" />
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
</properties>
</persistence-unit>
...
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Hibernate 4
- Spring
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
