SSH三大框架整合出现包冲突,要删除的jar包

时间:2021-06-18 20:35:03
首先删两个架包:
1.struts2的:Window-->Preferences-->myeclipse-->project capabilities-->struts2-->antlr-2.7.2.jar
2.hibernate的:Window-->Preferences-->myeclipse-->project capabilities-->Hibernate-->Hibernate3.3-->Hibernate3.3 Core-->cglib-2.2.jar


设置默认jsp页面utf-8编码:
Window-->Preferences-->myeclipse-->Files and Editors-->Jsp-->右侧Encoding选择即可




1.   Spring2 aop库包冲突
 
异常信息如下所示:


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V


Caused by:


java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
 
解决方案:此错误是包冲突引起的,请删除WEB-INF\lib目录下的asm-2.2.3.jar文件,最后的修改MyEclipse自带的spring2 aop库,以后就一劳永逸,如果已经发布了,则必须删除部署后的项目的WEB-INF\lib目录下的asm-2.2.3.jar文件,或者已发布的项目,然后重新发布。