搭建springBootZuul时出现以下异常:
The dependencies of some of the beans in the application context form a cycle:
┌──->──┐
| org.springframework.cloud.netflix.zuul.ZuulProxyAutoConfiguration (field private org.springframework.cloud.netflix.zuul.filters.discovery.ServiceRouteMapper org.springframework.cloud.netflix.zuul.ZuulProxyAutoConfiguration.serviceRouteMapper)
└──<-──┘
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.
虽然这个错误可以在application启动类加上以下这段代码解决,
SpringApplication springApplication = new SpringApplication(SpringBootZuulFilterApplication.class);
springApplication.setAllowCircularReferences(Boolean.TRUE);
springApplication.run(args);
但是我不明白是因为哪里导致依赖循环了,serviceRouteMapper这个类也不知道是干嘛用的,请大家指教一下!谢谢