Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm

来源:互联网 发布:淘宝劵 编辑:程序博客网 时间:2024/05/02 04:54

Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.DuplicateMappingException: Duplicate class/entity mapping Guestbook


利用myeclipse自动添加的struts,spring和hibernate框架,有的jar包重复,所以造成了冲突
,两个不同版本的asm的jar包混在一起导致这种错误。

把重复的删掉就可以了。
1.去掉类路径上的关于Hibernate的3个lib
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
2.加入Spring中的以下4个lib
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
cglib-nodep-2.1_3.jar

 

原创粉丝点击