SpringBoot启动时加载bean提示部分循环依赖问题

首先,我希望大佬们帮我确认一下,SpringBoot是不是对循环依赖进行了处理。因为之前我试过,ServiceA 调用ServiceB,ServieB调用ServiceC,ServiceC调用ServiceA,启动程序时,并没有报循环依赖的错误,我去网上查资料,说是SprintBoot已经进行了优化。
其次,我在程序中有四个class,比如A、B、C和D。然后在类A上加上@Servive注解,A中调用B,在类B上加上@Repository注解,类D上加@Service注解,D中也调用B,B中调用C,C是一个feign的接口,里面的方法都是通过http进行调用。同时我也确定C中没有再回调A和D。所有的调用都是通过Autowired方式。即使调用A,按照我的理解,SpringBoot已经处理过了。

A --> B --> C
D --> B --> C

  现在的问题是在启动程序时,会报错。

Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name ‘B’: Bean with name ‘B’ has been injected into other beans [D] in its raw version as part of a circular reference, but has eventually been wrapped.
This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using ‘getBeanNamesOfType’ with the ‘allowEagerInit’ flag turned off, for example.
我没有发现问题具体原因,暂时通过一下两种方式解决。
1.在类A中加载B的时候加上@lazy方式
@Autowired
@Lazy
B b;
2. 在类B上不用@Repository注解,采用@Service、@Controller和@Component均不会报错,只有@Repository会有错误
@Slf4j
@Repository(@Service、@Controller和@Component,此处加上三者任意一种,不会报错,只有@Repository会有错误)
public class B {
}
由于能力有限,关于SpringBoot框架源码解读有心无力,暂不能通过报错信息debug深度分析源码,只能希望有大神能帮忙解决一下

关于循环依赖的问题,我之前遇到过一次。
我的解决办法是,不使用构造方法注入,而是单独对某个Bean一个一个注入,解决。

​@Reponstory注解的bean spring 初始化bean时候通过PersistenceExceptionTranslationPostProcessor
会动态代理ProxyFactory生成新的proxy类,导致spring 处理循环引用的缓存eager 提前引用初始化缓存池里的 bean和这个bean实际上不是一个bean,版本不一致导致报错。 (为啥@Repository 要proxy一层生成一个新的bean,因为被spring定义为DDD仓储层,加了下仓储的数据库异常逻辑处理,在这里spring加了些逻辑)

​​ @Service @Component 没有在bean初始化的postProcessAfterInitialization 加任何处理逻辑不需要aop代理所以 循环引用直接用spring的eager 提前引用初始化缓存池没有问题。