报错信息提示:
ERROR [main] org.springframework.boot.SpringApplication [SpringApplication.java:843] - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘areaController’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘areaCountService’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name ‘fenceAreaRepository’: Bean with name ‘fenceAreaRepository’ has been injected into other beans [ODService,ODHttpAdaptor,residentHttpAdaptor,flowService,flowHttpAdaptor] 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 ‘getBeanNamesForType’ with the ‘allowEagerInit’ flag turned off, for example.
报错分析:
循环依赖
解决方案:
@Respority注解更换成为@Autired+@Lazy(spring的Lazy包),问题解决
原因分析:
1.与spring的三级缓存有关
2.与spring的加载顺序有关
3.一个bean在代码运行过程中使用了一个还没有进行初始化的bean