为了账号安全,请及时绑定邮箱和手机立即绑定

org.springframework.beans.factory.Unsatisfied

org.springframework.beans.factory.Unsatisfied

侃侃尔雅 2022-11-30 10:13:45
每个人!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或者你可以在下面看到我的代码:
查看完整描述

1 回答

?
沧海一幻觉

TA贡献1824条经验 获得超5个赞

能够在本地重现此问题并修复它。


尝试将 mysql-connector-java 的工件版本更新到最新


<dependency>

    <groupId>mysql</groupId>

    <artifactId>mysql-connector-java</artifactId>

    <version>8.0.16</version>

</dependency>

如果您使用的是最新/较新的 MySQL 版本(帖子中提到的版本除外),则这是必需的


相关问题:How to resolve Unable to load authentication plugin 'caching_sha2_password' issue


如果没有帮助,请提供完整的堆栈跟踪,否则接受解决方案。


顺便说一句,建议使用 spring boot,它更简单和高级。


查看完整回答
反对 回复 2022-11-30
  • 1 回答
  • 0 关注
  • 139 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信