人人开源The dependencies of some of the beans in the application context form a cycle
时间: 2023-11-01 14:56:06 浏览: 124
人人开源中出现"The dependencies of some of the beans in the application context form a cycle"的错误是由于使用了zuul作为网关,nacos作为注册中心时出现的循环依赖问题。具体错误信息是:
```
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.client.serviceregistry.Registration org.springframework.cloud.netflix.zuul.ZuulProxyAutoConfiguration.registration)
┌─────┐
| nacosRegistration defined in class path resource [com/alibaba/cloud/nacos/registry/NacosServiceRegistryAutoConfiguration.class]
↑ ↓
| nacosProperties (field private java.util.Optional com.alibaba.cloud.nacos.NacosDiscoveryProperties.nacosAutoServiceRegistrationOptional)
↑ ↓
| nacosAutoServiceRegistration defined in class path resource [com/alibaba/cloud/nacos/registry/NacosServiceRegistryAutoConfiguration.class]
└─────┘
```
这个错误一般是由于版本的不兼容引起的。根据引用中提到的问题,这个错误是在spring cloud 2.2.2.RELEASE版本中出现的。解决方法是将版本改为2.2.5.RELEASE,重新启动即可。
阅读全文