spring整合hibernate無法創建Bean----org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentDao' defined in file


報錯如下

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

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationPropertiesBeans' defined in class path resource Spring AOP 報錯org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource.......... org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jdbc.datasource.DataSourceTransactionManager#0' defined in class path resource [spring-mybat 使用security報錯:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource Spring Boot中啟動Tomcat報錯Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in ssm整合時出現 org.springframework.beans.factory.BeanCreationException :Error creating bean with name ‘XXX’ 異常的原因及解決方法 ssm整合時出現 org.springframework.beans.factory.BeanCreationException :Error creating bean with name ‘XXX’ 異常的原因及解決方法 SpringBoot 報 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapImportSelectorConfiguration': Initialization of bean failed; Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fundService': Injection of resource dependencies failed;
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM