{"record":{"id":"935d683d293c243a","repo":"hibernate/hibernate-orm","slug":"could-not-obtain-jboss-transactions-user-transacti","errorCode":null,"errorMessage":"Could not obtain JBoss Transactions user transaction instance","messagePattern":"Could not obtain JBoss Transactions user transaction instance","errorType":"exception","errorClass":"JtaPlatformException","httpStatus":null,"severity":"critical","filePath":"hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/JBossStandAloneJtaPlatform.java","lineNumber":68,"sourceCode":"\t@Override\n\tprotected UserTransaction locateUserTransaction() {\n\t\t//Try WildFly first as it's the \"new generation\":\n\t\ttry {\n\t\t\treturn wildflyBasedAlternative.locateUserTransaction();\n\t\t}\n\t\tcatch ( Exception ignore) {\n\t\t\t// ignore and look for Arjuna class\n\t\t}\n\n\t\ttry {\n\t\t\treturn (UserTransaction) serviceRegistry()\n\t\t\t\t\t.requireService( ClassLoaderService.class )\n\t\t\t\t\t.classForName( JBOSS_UT_CLASS_NAME )\n\t\t\t\t\t.getMethod( \"userTransaction\" )\n\t\t\t\t\t.invoke( null );\n\t\t}\n\t\tcatch ( Exception e ) {\n\t\t\tthrow new JtaPlatformException( \"Could not obtain JBoss Transactions user transaction instance\", e );\n\t\t}\n\t}\n}\n","sourceCodeStart":50,"sourceCodeEnd":72,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/JBossStandAloneJtaPlatform.java#L50-L72","documentation":"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.","triggerScenarios":"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().","commonSituations":"Narayana dependency pruning after an upgrade; fat jars excluding com.arjuna.ats.jbossatx; test classpaths containing only arjuna-core.","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"],"exampleFix":"// before: platform requires the jbossatx service class, which is absent\nhibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform\n\n// after: plain Narayana classes only\nhibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.NarayanaJtaPlatform","handlingStrategy":"validation","validationCode":"Class.forName(\"com.arjuna.ats.jbossatx.jta.TransactionManagerService\")\n     .getMethod(\"userTransaction\"); // static accessor must exist","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["jta","narayana","jboss","user-transaction","classpath"],"backgroundTag":"jta-platform-misconfiguration","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}