org.springframework.beans.factory.BeanCreationException

来源:互联网 发布:免费炒股软件 编辑:程序博客网 时间:2024/06/18 06:25

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.zj.usersdaoimpl.UserDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\apache-tomcat-7.0.42\webapps\CopyStart3\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Composite-id class must implement Serializable: com.zj.entity.Friend



这么一长串,看了半天,我发现我的bean配置没有问题。居然说错误的去创建 叫做userDaoImpl的bean。我也是醉醉的,我真看不懂错误是啥

但是!!我个人觉得重点在最后com.zj.entity.Friendmaybe这个是实体类有问题。果真我发现我的注解有问题,删掉不确定的注解就没有问题了。

ps:很多错误提示都是一长串,有时候可能误导你,so,you can see the last sentence!I hope this can help you!

阅读全文
0 0
原创粉丝点击