{"record":{"id":"8c07bc200a55114b","repo":"hibernate/hibernate-orm","slug":"could-not-obtain-jboss-transactions-transaction-ma","errorCode":null,"errorMessage":"Could not obtain JBoss Transactions transaction manager instance","messagePattern":"Could not obtain JBoss Transactions transaction manager 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":46,"sourceCode":"\n\t@Override\n\tprotected TransactionManager locateTransactionManager() {\n\t\t//Try WildFly first as it's the \"new generation\":\n\t\ttry {\n\t\t\treturn wildflyBasedAlternative.locateTransactionManager();\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 (TransactionManager) serviceRegistry().requireService( ClassLoaderService.class )\n\t\t\t\t\t.classForName( JBOSS_TM_CLASS_NAME )\n\t\t\t\t\t.getMethod( \"transactionManager\" )\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 transaction manager instance\", e );\n\t\t}\n\t}\n\n\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\" )","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/JBossStandAloneJtaPlatform.java#L28-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (pom.xml): standalone JBoss Transactions classes missing\n// after (pom.xml):\n<dependency>\n    <groupId>org.jboss.narayana.jta</groupId>\n    <artifactId>narayana-jta</artifactId>\n    <version>7.0.2.Final</version>\n</dependency>","handlingStrategy":"validation","validationCode":"Class.forName(\"com.arjuna.ats.jbossatx.jta.TransactionManagerService\");\n// resolves only with the standalone Narayana (jbossatx) classes on the classpath","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["jta","narayana","jboss","classpath","transaction-manager"],"backgroundTag":"jta-platform-misconfiguration","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}