SSH整合的依賴包衝突問題
Spring所依賴的包,有時候會與其它框架所依賴的包造成衝突,引起系統一些摸不清楚的問題,最近就遇到了兩個這方面的問題。
1、spring與hibernate的衝突.兩個框架都依賴asm.jar包spring的版本是asm-2.23.jar.hibernate依賴的是asm.jar
需要將asm-2.2.3.jar刪除.沒有刪除的話會引起這樣的異常:
"org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
Caused by:...
2、hibernate 與struts的衝突,兩個框架都依賴common-collections.jar.hibernate的是common-collections-2.1.1.jar,struts的是common-collections.jar.需要將hibernate所依賴的common- collections-2.1.1.jar刪除.沒有刪除的話會引起這個異常:
java.lang.SecurityException: class "org.apache.commons.collections.ArrayStack"'s signer information does not match signer information of other classes in the same package...