hibernate/hibernate-orm · critical · JtaPlatformException
Could not obtain JBoss Transactions transaction manager inst
Error message
Could not obtain JBoss Transactions transaction manager instance
What it means
JBossStandAloneJtaPlatform first tries the WildFly Transaction Client and, failing that, reflectively calls transactionManager() on com.arjuna.ats.jbossatx.jta.TransactionManagerService. JtaPlatformException('Could not obtain JBoss Transactions transaction manager instance') means that Arjuna jbossatx fallback class is missing, not loadable, or its static method threw — the standalone JBoss Transactions runtime is not properly on the classpath.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/JBossStandAloneJtaPlatform.java:46
@Override
protected TransactionManager locateTransactionManager() {
//Try WildFly first as it's the "new generation":
try {
return wildflyBasedAlternative.locateTransactionManager();
}
catch ( Exception ignore) {
// ignore and look for Arjuna class
}
try {
return (TransactionManager) serviceRegistry().requireService( ClassLoaderService.class )
.classForName( JBOSS_TM_CLASS_NAME )
.getMethod( "transactionManager" )
.invoke( null );
}
catch ( Exception e ) {
throw new JtaPlatformException( "Could not obtain JBoss Transactions transaction manager instance", e );
}
}
@Override
protected UserTransaction locateUserTransaction() {
//Try WildFly first as it's the "new generation":
try {
return wildflyBasedAlternative.locateUserTransaction();
}
catch ( Exception ignore) {
// ignore and look for Arjuna class
}
try {
return (UserTransaction) serviceRegistry()
.requireService( ClassLoaderService.class )
.classForName( JBOSS_UT_CLASS_NAME )
.getMethod( "userTransaction" )View on GitHub (pinned to fad1729dce)
Solutions
- Add the standalone Narayana artifacts (org.jboss.narayana.jta:narayana-jta plus its transitive arjuna jars)
- Or move to WildFlyStandAloneJtaPlatform together with org.wildfly.transaction.client:wildfly-transaction-client
- Or use NarayanaJtaPlatform, which only needs the plain com.arjuna.ats.jta facade
- Verify Class.forName("com.arjuna.ats.jbossatx.jta.TransactionManagerService") succeeds under Hibernate's classloader
Example fix
// before (pom.xml): standalone JBoss Transactions classes missing
// after (pom.xml):
<dependency>
<groupId>org.jboss.narayana.jta</groupId>
<artifactId>narayana-jta</artifactId>
<version>7.0.2.Final</version>
</dependency> Defensive patterns
Strategy: validation
Validate before calling
Class.forName("com.arjuna.ats.jbossatx.jta.TransactionManagerService");
// resolves only with the standalone Narayana (jbossatx) classes on the classpath Prevention
- Keep org.jboss.narayana.jta:narayana-jta on the classpath when using JBossStandAloneJtaPlatform
- Set the jta.platform property explicitly in standalone deployments
- Bootstrap-test the SessionFactory in CI with the production dependencies
- Prefer NarayanaJtaPlatform/WildFlyStandAloneJtaPlatform over the legacy jbossatx fallback
When it happens
Trigger: hibernate.transaction.jta.platform=JBossStandAloneJtaPlatform without the org.jboss.narayana.jta (jbossatx) jars; both the WildFly client and jbossatx absent so the reflective call throws ClassNotFoundException; classloader isolation in shaded or embedded containers.
Common situations: Spring applications historically configured with JBossStandAloneJtaPlatform after dropping Narayana dependencies; Narayana upgrades where jbossatx moved artifacts; unit tests running with only part of the Arjuna stack.
Related errors
- Could not obtain JBoss Transactions user transaction instanc
- Could not obtain Narayana TransactionManager instance
- Could not instantiate Atomikos TransactionManager
- unable to find transaction manager
- Could not obtain Narayana UserTransaction instance
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/8c07bc200a55114b.
Report an issue: GitHub.