The dependencies of some of the beans in the application context form a cycl

一、问题 : The dependencies of some of the beans in the application context form a

一、问题 :

The dependencies of some of the beans in the application context form a cycl

若依plus前后端分离版本框架springboot项目

解决升级 Spring Boot 2.6后,因循环引用导致启动时报错的问题

二、过程:

又遇到这个问题了,按照之前写的文章在yml文件添加 下面配置不好用了,还是启动失败,循环依赖导致的,maven clean install也不好使

(11条消息) 解决升级 Spring Boot 2.6后,因循环引用导致启动时报错的问题_奔波霸的伶俐虫的博客-CSDN博客_springboot循环引用启动报错

 

参考了上面方法后,感觉没看懂但是有点思路了 

三、解决办法:

 1、原来两个文件互相引用是下面的形式private final ****

//1文件
private final IScenicEvaluateService scenicEvaluateService;
//2文件
private final IScenicIntroduceService iScenicIntroduceService;

2、现在把那种形式的改成@Autowired注解形式的

 3、然后再在yml文件里面配置一下就可以启动成功了

四、结果: