报错如下

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentDao' defined in file [E:\IDEAWorkplace\Drive\target\classes\com\luoda\dao\Impl\StudentDao.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required

 

错误截图

 

 

解决方案 :

dao层实现类需继承 HIbernateDaoSupport类  并且内部需指定SessionFactory

 

 

 

posted on 2019-11-13 18:21  乡河布衣  阅读(1296)  评论(0编辑  收藏  举报