{"record":{"id":"867fb206d9311a43","repo":"hibernate/hibernate-orm","slug":"could-not-obtain-wildfly-transaction-client-transa","errorCode":null,"errorMessage":"Could not obtain WildFly Transaction Client transaction manager instance","messagePattern":"Could not obtain WildFly Transaction Client transaction manager 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":33,"sourceCode":" * Known to work for WildFly 13+\n *\n * @author Scott Marlow\n */\npublic class WildFlyStandAloneJtaPlatform extends AbstractJtaPlatform {\n\tpublic static final String WILDFLY_TM_CLASS_NAME = \"org.wildfly.transaction.client.ContextTransactionManager\";\n\tpublic static final String WILDFLY_UT_CLASS_NAME = \"org.wildfly.transaction.client.LocalUserTransaction\";\n\n\t@Override\n\tprotected TransactionManager locateTransactionManager() {\n\t\ttry {\n\t\t\treturn (TransactionManager) serviceRegistry()\n\t\t\t\t\t.requireService( ClassLoaderService.class )\n\t\t\t\t\t.classForName( WILDFLY_TM_CLASS_NAME )\n\t\t\t\t\t.getMethod( \"getInstance\" )\n\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);","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/WildFlyStandAloneJtaPlatform.java#L15-L51","documentation":"WildFlyStandAloneJtaPlatform.locateTransactionManager() reflectively calls getInstance() on org.wildfly.transaction.client.ContextTransactionManager. JtaPlatformException('Could not obtain WildFly Transaction Client transaction manager instance') means the wildfly-transaction-client library is missing or not visible, so the standalone WildFly transaction manager cannot be obtained.","triggerScenarios":"hibernate.transaction.jta.platform=WildFlyStandAloneJtaPlatform without org.wildfly.transaction.client:wildfly-transaction-client on the classpath; shaded jars stripping the client classes; a version mismatch where getInstance() throws.","commonSituations":"Spring Boot apps wanting the WildFly transaction client for standalone XA but forgetting the dependency; dependency conflicts between wildfly-transaction-client and an embedded Narayana.","solutions":["Add org.wildfly.transaction.client:wildfly-transaction-client to the runtime classpath","Match the client version to the Narayana version in use (use the pair shipped with your WildFly)","If plain Narayana suffices, switch to NarayanaJtaPlatform instead","Smoke-test Class.forName(\"org.wildfly.transaction.client.ContextTransactionManager\") at startup"],"exampleFix":"// before (pom.xml): client jar missing\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.ContextTransactionManager\");\n// present only when wildfly-transaction-client is on the runtime classpath","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add org.wildfly.transaction.client:wildfly-transaction-client when using WildFlyStandAloneJtaPlatform","Pin client and Narayana versions to the pair shipped with your WildFly","Keep the jta.platform setting explicit in standalone deployments","Add a CI bootstrap check for the reflective classes"],"tags":["jta","wildfly","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"}