hibernate/hibernate-orm · critical · JtaPlatformException
Could not obtain JBoss Transactions user transaction instanc
Error message
Could not obtain JBoss Transactions user transaction instance
What it means
The UserTransaction half of JBossStandAloneJtaPlatform: after the WildFly client attempt is ignored, locateUserTransaction() reflectively calls userTransaction() on com.arjuna.ats.jbossatx.jta.TransactionManagerService. The JtaPlatformException means the jbossatx classes needed by the standalone fallback are absent or the static call failed, so Hibernate cannot hand out a UserTransaction for this JVM.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/JBossStandAloneJtaPlatform.java:68
@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" )
.invoke( null );
}
catch ( Exception e ) {
throw new JtaPlatformException( "Could not obtain JBoss Transactions user transaction instance", e );
}
}
}
View on GitHub (pinned to fad1729dce)
Solutions
- Add org.jboss.narayana.jta:narayana-jta so com.arjuna.ats.jbossatx.jta.TransactionManagerService is present
- Prefer NarayanaJtaPlatform or WildFlyStandAloneJtaPlatform, which do not rely on the legacy jbossatx service class
- Keep the jta.platform property explicit and bootstrap-test the SessionFactory in CI
- Check for jar conflicts on com.arjuna.* across the dependency tree
Example fix
// before: platform requires the jbossatx service class, which is absent hibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform // after: plain Narayana classes only hibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.NarayanaJtaPlatform
Defensive patterns
Strategy: validation
Validate before calling
Class.forName("com.arjuna.ats.jbossatx.jta.TransactionManagerService")
.getMethod("userTransaction"); // static accessor must exist Prevention
- Ensure the jbossatx service class is present whenever JBossStandAloneJtaPlatform is configured
- Avoid dependency pruning that keeps only part of the Arjuna stack
- Check for jar conflicts on com.arjuna.* after upgrades
- Use NarayanaJtaPlatform to avoid the legacy service class entirely
When it happens
Trigger: Same deployment gap as the TransactionManager variant: JBossStandAloneJtaPlatform configured without Narayana/jbossatx jars; partially present Arjuna jars (facade classes present, jbossatx service class missing); reflective failure inside TransactionManagerService.userTransaction().
Common situations: Narayana dependency pruning after an upgrade; fat jars excluding com.arjuna.ats.jbossatx; test classpaths containing only arjuna-core.
Related errors
- Could not obtain JBoss Transactions transaction manager inst
- Could not obtain Narayana UserTransaction instance
- unable to find UserTransaction
- Could not obtain Narayana TransactionManager instance
- Could not obtain WildFly Transaction Client user transaction
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/935d683d293c243a.
Report an issue: GitHub.