"JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate" using Hibernate in JBoss EAP 7
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.platformcould be set in thepersistence.xmlto 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, tools, and much more.