`
wayne446
  • 浏览: 27915 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

Spring集成Hibernate的BeanCreationException解决方法

    博客分类:
  • j2ee
阅读更多

 
现象:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in ServletContext resource [/WEB-INF/applicationContextService.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError


问题:
在使用Spring的AOP编程时,会用到这几个lib:
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar

cglib-nodep-2.1_3.jar
Hibernate使用的lib:
asm.jar
asm-attrs.jar
其中asm-2.2.2.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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics