码迷,mamicode.com
首页 > 编程语言 > 详细

Hibernate:initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

时间:2014-10-10 21:54:44      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:style   color   io   ar   java   strong   sp   on   cti   

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 ‘userAction‘: Injection of resource fields failed; nested exception         is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userService‘: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userDao‘: Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘hibernateTemplate‘ defined in class path resource [spring/applicationContext-db.xml]: Cannot resolve reference to bean ‘sessionFactory‘ while setting bean property ‘sessionFactory‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory‘ defined in class path resource [spring/applicationContext-db.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/persistence/Entity

 

 

由NoClassDefFoundError可以知道,明显是缺少包,再百度一下javax/persistence/Entity,答案出来了,少了hibernate-jpa-2.0-api-1.0.0.Final.jar,导入之后就行了

Hibernate:initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

标签:style   color   io   ar   java   strong   sp   on   cti   

原文地址:http://www.cnblogs.com/D-Key/p/4017689.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!