当前位置: 代码迷 >> J2SE >> 求解啊解决方案
  详细解决方案

求解啊解决方案

热度:86   发布时间:2016-04-24 00:37:00.0
求解啊。
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

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