读书人

求解啊解决办法

发布时间: 2013-09-11 17:27:29 作者: rapoo

求解啊。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in file [D:\file\myeclipsese\RPIntoSavePinSystem\bin\spring\applicationContext-common.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 file [D:\file\myeclipsese\RPIntoSavePinSystem\bin\spring\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.ruipengkj.bean.TWorkShift.TEmployee in com.ruipengkj.bean.TEmployee.TWorkShifts
[解决办法]
nested exception is org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.ruipengkj.bean.TWorkShift.TEmployee in com.ruipengkj.bean.TEmployee.TWorkShifts

com.ruipengkj.bean.TWorkShift.TEmployee 这个没有注册spring的bean吧,在这个类上加个@Component

[解决办法]
问题原因是很多的,不一定出在哪。
可能是少包,可能是你的配置文件,哪个字母写错了,配置属性写错了。
仔细检查下吧,如果是根据哪个学习材料敲的代码,好好对比下哪不一样。就是小问题。

读书人网 >J2SE开发

热点推荐