{"record":{"id":"0293477d4a2f809e","repo":"hibernate/hibernate-orm","slug":"could-not-obtain-websphere-liberty-transaction-man","errorCode":null,"errorMessage":"Could not obtain WebSphere Liberty transaction manager instance","messagePattern":"Could not obtain WebSphere Liberty transaction manager instance","errorType":"exception","errorClass":"JtaPlatformException","httpStatus":null,"severity":"critical","filePath":"hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/WebSphereLibertyJtaPlatform.java","lineNumber":39,"sourceCode":" * @author Andrew Guibert\n * @author Nathan Rauh\n */\npublic class WebSphereLibertyJtaPlatform extends AbstractJtaPlatform {\n\n\tpublic static final String TMF_CLASS_NAME = \"com.ibm.tx.jta.TransactionManagerFactory\";\n\n\tpublic static final String UT_NAME = \"java:comp/UserTransaction\";\n\n\t@Override\n\tprotected TransactionManager locateTransactionManager() {\n\t\ttry {\n\t\t\treturn (TransactionManager) serviceRegistry().requireService( ClassLoaderService.class )\n\t\t\t\t\t.classForName( TMF_CLASS_NAME )\n\t\t\t\t\t.getMethod(\"getTransactionManager\")\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 WebSphere Liberty transaction manager instance\", e );\n\t\t}\n\t}\n\n\t@Override\n\tprotected UserTransaction locateUserTransaction() {\n\t\treturn (UserTransaction) jndiService().locate( UT_NAME );\n\t}\n\n\t@Override\n\tpublic boolean canRegisterSynchronization() {\n\t\ttry {\n\t\t\treturn getCurrentStatus() == Status.STATUS_ACTIVE;\n\t\t}\n\t\tcatch (SystemException x) {\n\t\t\tthrow new RuntimeException(x);\n\t\t}\n\t}\n","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/transaction/jta/platform/internal/WebSphereLibertyJtaPlatform.java#L21-L57","documentation":"WebSphereLibertyJtaPlatform.locateTransactionManager() reflectively calls getTransactionManager() on com.ibm.tx.jta.TransactionManagerFactory. JtaPlatformException('Could not obtain WebSphere Liberty transaction manager instance') means the IBM transaction classes were not reachable — classic WebSphere (which needs a different platform), Liberty with classloader visibility hiding com.ibm.tx.*, or running outside WebSphere entirely.","triggerScenarios":"WebSphereLibertyJtaPlatform configured while running on classic WAS or a non-IBM server; PARENT_LAST classloading isolating the web module from IBM classes; Hibernate bundled inside the application while the IBM transaction classes live in a server-parent classloader with restricted access.","commonSituations":"Apps migrated between classic WAS and Liberty keeping the wrong platform property; third-party jars forcing a jta.platform value; shared-library misconfiguration on Liberty.","solutions":["Use WebSphereExtendedJtaPlatform on classic WebSphere and WebSphereLibertyJtaPlatform only on Liberty profile","Set hibernate.transaction.jta.platform explicitly to the correct fully-qualified class instead of relying on auto-detection","Load Hibernate through a Liberty shared library with proper visibility instead of a hidden WEB-INF copy","Confirm Class.forName(\"com.ibm.tx.jta.TransactionManagerFactory\") works from the application classloader"],"exampleFix":"// before: Liberty platform configured on classic WebSphere\nhibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.WebSphereLibertyJtaPlatform\n\n// after: correct platform for classic WebSphere\nhibernate.transaction.jta.platform=org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform","handlingStrategy":"validation","validationCode":"Class.forName(\"com.ibm.tx.jta.TransactionManagerFactory\");\n// must be loadable from the application classloader on Liberty","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match the platform to the server: WebSphereExtendedJtaPlatform for classic WAS, WebSphereLibertyJtaPlatform for Liberty","Set hibernate.transaction.jta.platform explicitly rather than trusting auto-detection","Deploy Hibernate via a Liberty shared library with correct visibility","Test SessionFactory bootstrap on the target server profile in CI"],"tags":["jta","websphere","liberty","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"}