"JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate" using Hibernate in JBoss EAP 7

Solution Verified - Updated -

Issue

  • Explicitly creating an un-managed entity manager factory / entity manager in application code

    // EMF/EM managed by application code rather than by JBoss
    EntityManagerFactory entityManagerFactory = javax.persistence.Persistence.createEntityManagerFactory("my-persist-unit");
    EntityManager entityManager = entityManagerFactory.create(); // this fails
    
  • The exception below is raised during entity manager creation

    ... org.hibernate.resource.transaction.backend.jta.internal.JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate
            at org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.makePhysicalTransactionDelegate(JtaTransactionCoordinatorImpl.java:229)
            ...
            at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:286)
            at com.myco.EntityManagerHelper.getEntityManager(EntityManagerHelper.java:99)
            ...
    
  • It was observed that hibernate.transaction.jta.platform could be set in the persistence.xml to work around the exception.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7
  • Hibernate 5 JPA

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.