org.springframework.beans.factory.Unsatisfied

每个人!

Java + Eclipse + Maven + SpringMVC + Hibernate + Tomcat

我通过手册https://www.boraji.com/index.php/spring-mvc-4-hibernate-5-restful-crud-operations-example制作的项目完全相同,它不能在我的 Eclipse 中工作(((因为:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookDaoImpl': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSessionFactory' defined in com.example.spring.config.AppConfig: Invocation of init method failed;

有什么帮助吗,我必须为我的项目工作修复什么?现在 CRUD 方法不起作用,但服务器 Tomcat 正在运行......

我的项目在https://github.com/OlegSandro/library-service或者你可以在下面看到我的代码:


侃侃尔雅
浏览 203回答 1
1回答

沧海一幻觉

能够在本地重现此问题并修复它。尝试将 mysql-connector-java 的工件版本更新到最新<dependency>&nbsp; &nbsp; <groupId>mysql</groupId>&nbsp; &nbsp; <artifactId>mysql-connector-java</artifactId>&nbsp; &nbsp; <version>8.0.16</version></dependency>如果您使用的是最新/较新的 MySQL 版本(帖子中提到的版本除外),则这是必需的相关问题:How to resolve Unable to load authentication plugin 'caching_sha2_password' issue如果没有帮助,请提供完整的堆栈跟踪,否则接受解决方案。顺便说一句,建议使用 spring boot,它更简单和高级。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java