{"record":{"id":"86f5e107be7acc33","repo":"hibernate/hibernate-orm","slug":"could-not-obtain-wildfly-transaction-client-user-t","errorCode":null,"errorMessage":"Could not obtain WildFly Transaction Client user transaction instance","messagePattern":"Could not obtain WildFly Transaction Client user transaction instance","errorType":"exception","errorClass":"JtaPlatformException","httpStatus":null,"severity":"critical","filePath":"hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/WildFlyStandAloneJtaPlatform.java","lineNumber":48,"sourceCode":"\t\t\t\t\t.invoke( null );\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new JtaPlatformException(\n\t\t\t\t\t\"Could not obtain WildFly Transaction Client transaction manager instance\",\n\t\t\t\t\te\n\t\t\t);\n\t\t}\n\t}\n\n\t@Override\n\tprotected UserTransaction locateUserTransaction() {\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( WILDFLY_UT_CLASS_NAME ).getMethod( \"getInstance\" ).invoke( null );\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new JtaPlatformException(\n\t\t\t\t\t\"Could not obtain WildFly Transaction Client user transaction instance\",\n\t\t\t\t\te\n\t\t\t);\n\t\t}\n\t}\n}\n","sourceCodeStart":30,"sourceCodeEnd":55,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/WildFlyStandAloneJtaPlatform.java#L30-L55","documentation":"The UserTransaction counterpart on WildFlyStandAloneJtaPlatform: locateUserTransaction() reflectively calls getInstance() on org.wildfly.transaction.client.LocalUserTransaction and throws JtaPlatformException('Could not obtain WildFly Transaction Client user transaction instance') when the client library is absent or that class cannot be invoked. Hibernate then cannot supply a UserTransaction for the standalone WildFly transaction setup.","triggerScenarios":"Missing org.wildfly.transaction.client:wildfly-transaction-client (the LocalUserTransaction class specifically); partial shading that keeps ContextTransactionManager but drops the local UT class; a client version too old to expose LocalUserTransaction.getInstance().","commonSituations":"Same deployment shape as the TM variant: standalone Spring/Narayana setups where the WildFly transaction client is half-present or version-skewed.","solutions":["Add or repair org.wildfly.transaction.client:wildfly-transaction-client","Verify the class is present: Class.forName(\"org.wildfly.transaction.client.LocalUserTransaction\")","Align client and Narayana versions, or fall back to NarayanaJtaPlatform","Keep hibernate.transaction.jta.platform explicit in standalone deployments"],"exampleFix":"// before (pom.xml): client jar missing or incomplete\n// after (pom.xml):\n<dependency>\n    <groupId>org.wildfly.transaction.client</groupId>\n    <artifactId>wildfly-transaction-client</artifactId>\n    <version>2.0.1.Final</version>\n</dependency>","handlingStrategy":"validation","validationCode":"Class.forName(\"org.wildfly.transaction.client.LocalUserTransaction\");\n// the exact class WildFlyStandAloneJtaPlatform invokes for the UT","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify both ContextTransactionManager and LocalUserTransaction are loadable","Avoid partial shading of wildfly-transaction-client","Use a matched client/Narayana version set","Fall back to NarayanaJtaPlatform when the WildFly client is not required"],"tags":["jta","wildfly","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"}