hibernate/hibernate-orm · critical · JndiException
unable to find transaction manager
Error message
unable to find transaction manager
What it means
JBossAppServerJtaPlatform.locateTransactionManager() looks up the TransactionManager in JNDI, first at the AS7+ name java:jboss/TransactionManager, then at the legacy AS4 name java:/TransactionManager. When both lookups throw JndiException, Hibernate gives up with JndiException('unable to find transaction manager'): the platform is running somewhere without JBoss-style JNDI naming, or the names are not bound.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/JBossAppServerJtaPlatform.java:38
public static final String JBOSS_UT_NAME = "java:jboss/UserTransaction";
public static final String UT_NAME = "java:comp/UserTransaction";
@Override
protected boolean canCacheUserTransactionByDefault() {
return true;
}
@Override
protected TransactionManager locateTransactionManager() {
try {
return (TransactionManager) jndiService().locate( AS7_TM_NAME );
}
catch (JndiException jndiException) {
try {
return (TransactionManager) jndiService().locate( AS4_TM_NAME );
}
catch (JndiException jndiExceptionInner) {
throw new JndiException( "unable to find transaction manager", jndiException );
}
}
}
@Override
protected UserTransaction locateUserTransaction() {
try {
return (UserTransaction) jndiService().locate( JBOSS_UT_NAME );
}
catch (JndiException jndiException) {
try {
return (UserTransaction) jndiService().locate( UT_NAME );
}
catch (JndiException jndiExceptionInner) {
throw new JndiException( "unable to find UserTransaction", jndiException );
}
}
}View on GitHub (pinned to fad1729dce)
Solutions
- Outside JBoss/WildFly switch to JBossStandAloneJtaPlatform or NarayanaJtaPlatform (with Narayana dependencies on the classpath)
- Inside WildFly remove the explicit jta.platform override so the container injects the correct platform
- Remove hibernate-core from the deployment and use the Hibernate module provided by WildFly
- Sanity-check new InitialContext().lookup("java:jboss/TransactionManager") in the target environment
Example fix
// before: app-server platform used in a standalone JVM hibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.JBossAppServerJtaPlatform // after: standalone with Narayana on the classpath hibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform
Defensive patterns
Strategy: validation
Validate before calling
// must resolve when running on JBoss AS7+/WildFly
new javax.naming.InitialContext().lookup("java:jboss/TransactionManager");
// NamingException here means: not a JBoss naming environment -> use a standalone JtaPlatform Prevention
- Use JBossAppServerJtaPlatform only inside JBoss/WildFly
- For standalone Narayana set jta.platform to JBossStandAloneJtaPlatform or NarayanaJtaPlatform explicitly
- Do not bundle a private hibernate-core in WildFly deployments, it defeats container platform detection
- Smoke-test the JNDI names at application startup and fail with a clear message
When it happens
Trigger: Configuring JBossAppServerJtaPlatform outside JBoss AS/WildFly; a WildFly deployment bundling its own Hibernate so container naming/TM setup is bypassed; an explicit hibernate.transaction.jta.platform override pointing at the app-server platform in a plain JVM.
Common situations: Porting a WildFly app to standalone Spring Boot with Narayana but keeping the old platform property; integration tests that bootstrap Hibernate outside the container; WARs shipping hibernate-core in WEB-INF/lib instead of using the WildFly module.
Related errors
- unable to find UserTransaction
- Could not obtain JBoss Transactions transaction manager inst
- Could not obtain WildFly Transaction Client transaction mana
- Could not obtain TransactionManager from JtaPlatform
- Problem locating/validating JTA transaction
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/4d421990018b6b41.
Report an issue: GitHub.