報錯如下
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