标签: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,导入之后就行了
标签:style color io ar java strong sp on cti
原文地址:http://www.cnblogs.com/D-Key/p/4017689.html