我們正在從WAS 6.1遷移到8.5。我只是複製了我們用來在6.1到8.5中部署的EAR文件。該應用程序運行良好,我很高興,直到網絡管理員決定打開Java2安全。當前was.policy文件具有java.security.AllPermission。但我想這不適用於java2安全性,所以我改變了它,並授予每個讀/寫文件的權限。在此之後,相關的錯誤所有權限都沒有了,但我堅持一個奇怪的例外:Websphere 8.5升級和java2安全性 - 春季交易中的奇怪錯誤
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wsJtaTm' defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean]:
Constructor threw exception; nested exception is
org.springframework.transaction.TransactionSystemException: Could not find WebSphere 5.1/6.0/6.1 TransactionManager factory class; nested exception is
java.lang.ClassNotFoundException: com.ibm.ws.Transaction.TransactionManagerFactory
我Spring事務的定義是這樣的:
<bean id="wsJtaTm"
class="org.springframework.transaction.jta.WebSphereTransactionManagerFactoryBean" />
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="wsJtaTm" />
</bean>
我不明白爲什麼應用程序在關閉Java2安全性時會起作用,爲什麼會在打開java2安全性時拋出ClassNotFound異常。
據我所知,com.ibm.ws.Transaction.TransactionManagerFactory應該由服務器本身加載,並且應該可用於應用程序。我的應用沒有這個課程的任何jar。
錯誤源於bean id wsJtaTm的構造函數。我在was.policy文件中丟失了什麼?
在進一步的研究中,我發現這個類存在於服務器安裝的plugins文件夾中名爲com.ibm.ws.runtime.jar的jar文件中。我不明白爲什麼當java2安全打開時這個jar變得不可見。
請注意我正在使用spring v2.5
請幫忙。