Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException:

时间:2023-03-08 22:17:37
Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException:

严重: 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 'daoSupport': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [spring/ApplicationContext.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/ApplicationContext.xml]: Invocation of init method failed;

时常报这个错误,时好时坏,经常重启计算机或清理工程更新maven就会好,但是有时候遇到还是非常苦恼,一弄就是浪费好几个小时,今天终于找到问题的根源,希望大家在遇到这个问题的时候,能够对你们有些许帮助

问题原因:由于Spring中的“asm-2.2.3.jar”和Hibernate中的“asm.jar”包冲突。解决办法是移除Spring2.0 AOP Libraries中的“asm-2.2.3.jar”即可

工程-->右键-->build path --->configue build path-->Java Build Path
--->Libraries--->Remove