0
我們有一個使用Hibernate 3.1.3的漂亮的舊應用程序。我們正在升級到Hibernate 3.2.7(我知道它仍然是舊版本的hibernate,最終我們打算遷移到4.x版)。 我得到這個exception.We都在使用我們的自定義「manager_lookup_class」,呼籲在Transactionmanagerfactory得到事務管理Websphere 8.5和Hibernate 3.2.7用戶TransactionManager錯誤
used by: org.hibernate.TransactionException: Could not find UserTransaction in JNDI [java:comp/UserTransaction]
at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:172)
at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:148)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:172)
at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:76)
at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:214)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:574)
at org.hibernate.context.JTASessionContext.buildOrObtainSession(JTASessionContext.java:114)
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:80)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:591)
at com.dataaccess.utility.hibernate.impl.SessionManagerImpl.getSession(SessionManagerImpl.java:319)
at com.dataaccess.handler.hibernate.impl.HandlerAdapter.getSession(HandlerAdapter.java:83)
at com.dataaccess.handler.hibernate.impl.BatchProcessingHandlerImpl.flush(BatchProcessingHandlerImpl.java:344)
at com.dataaccess.handler.hibernate.impl.BatchProcessingHandlerImpl.batchDelete(BatchProcessingHandlerImpl.java:406)
... 34 more
Caused by: javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1229)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1142)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookupExt(UrlContextImpl.java:1436)
at com.ibm.ws.naming.java.javaURLContextImpl.lookupExt(javaURLContextImpl.java:477)
at com.ibm.ws.naming.java.javaURLContextRoot.lookupExt(javaURLContextRoot.java:485)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:370)
at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
at javax.naming.InitialContext.lookup(InitialContext.java:436)
at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:162)
... 46 more
感謝您的回答。當我試圖將HIbernate 3.1.3升級到3.2時,此問題即將到來。在與hibernate 3.1.3相同的服務器環境中,它工作正常。奇怪的是我拿了一個dumpNamespace,並且「comp/UserTransaction」在兩種情況下都不存在。尋找更多的建議。再次感謝 – Maverick