What causes JtaStatusHelper to throw a NullPointerException when using Spring, Hibernate 4, and JTA in JBoss EAP 6?

Solution Verified - Updated -

Issue

When using Spring 3, Hibernate 4, and JTA in JBoss EAP 6, an exception like the following is thrown:

caused by: null: java.lang.NullPointerException
    at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:73) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:115) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149) [hibernate-core-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1215) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.hibernate.ejb.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:177) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.hibernate.ejb.EntityManagerImpl.<init>(EntityManagerImpl.java:89) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:179) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:174) [hibernate-entitymanager-4.1.3.Final-redhat-1.jar:4.1.3.Final-redhat-1]
    at org.springframework.orm.jpa.EntityManagerFactoryUtils.doGetTransactionalEntityManager(EntityManagerFactoryUtils.java:195) [spring-orm-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.springframework.orm.jpa.EntityManagerFactoryUtils.getTransactionalEntityManager(EntityManagerFactoryUtils.java:141) [spring-orm-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.springframework.orm.jpa.EntityManagerFactoryAccessor.getTransactionalEntityManager(EntityManagerFactoryAccessor.java:129) [spring-orm-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:173) [spring-orm-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146) [spring-orm-3.0.7.RELEASE.jar:3.0.7.RELEASE]

Environment

  • JBoss Enterprise Application Platform (EAP) 6
  • Hibernate 4
  • Spring 3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.