报错信息:
Description:
The dependencies of some of the beans in the application context form a cycle:
┌──->──┐
| helloController (field private org.springframework.web.client.RestTemplate com.example.jcloudsonsumer.controller.HelloController.restTemplate)
└──<-──┘
Action:
Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.
解决办法:
spring:
main:
#解决spring boot2.6因循环引用导致启动时报错
allow-circular-references: true