websphere liberty profile 无法实例化 TransactionManagerLookup,原因是:java.lang.ClassNotFoundException:com.ibm.ejs.jts.jta.JTSXA

websphere liberty profile Could not instantiate TransactionManagerLookup caused by: java.lang.ClassNotFoundException: com.ibm.ejs.jts.jta.JTSXA

这需要很多时间才能解决。我在 8.0 上有一个 portlet 应用程序,并使用 hibernate 进行数据库事务处理。我正在尝试将其迁移到 8.5.5 liberty profile。我们使用的是 hibernate 3.6.9。

persistance.xml 看起来像这样:

    <property name="jpaProperties">
        <value>
            hibernate.transaction.manager_lookup_class=org.hibernate.transaction.WebSphereTransactionManagerLookup
            hibernate.current_session_context_class=jta
            hibernate.transaction.flush_before_completion=true
            hibernate.connection.release_mode=auto
        </value>
    </property>

日志:

00000278 org.hibernate.transaction.TransactionFactoryFactory          I Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
[8/13/15 0:39:28:182 CDT] 00000278 org.hibernate.transaction.TransactionManagerLookupFactory    I instantiating TransactionManagerLookup: org.hibernate.transaction.WebSphereTransactionManagerLookup
[8/13/15 0:39:28:185 CDT] 00000278 org.hibernate.transaction.TransactionManagerLookupFactory    E Could not instantiate TransactionManagerLookup
org.hibernate.HibernateException: Could not obtain WebSphere TransactionManagerFactory instance
...........
..................
........................

Caused by: java.lang.ClassNotFoundException: com.ibm.ejs.jts.jta.JTSXA
    at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:424)
    at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:257)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:402)
    at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:373)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:191)
    at org.hibernate.transaction.WebSphereTransactionManagerLookup.<init>(WebSphereTransactionManagerLookup.java:67)
    ... 80 more

有什么建议吗?

根据 WebSphereTransactionManagerLookup javadoc:

TransactionManagerLookup strategy for WebSphere (versions 4, 5.0 and 5.1)

请尝试使用 WebSphereExtendedJTATransactionLookup