您的位置:首页 > 移动开发

Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm

2016-06-02 19:35 751 查看
sessionFactory创建失败,诸多的小细节自己漏了,我的查找范围是,先看看sessionFactory这个bean有没有错,再看hibernate.cfg.xml配置(粗心是魔鬼),最后看实体类的映射文件配置有没有问题。

果然,最后在一个entity的映射文件中发现class只有路径,漏了entity类名。。。果然故障是70%出自自己的粗心。。



ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException:
entity class not found: cn.bdqn.stock.entity

粗心还可以造就找故障和解决方法的效率,自己动脑子了和知识面广了才能铺好自己的路,当然粗心是要不得滴
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: