第一句子网 - 唯美句子、句子迷、好句子大全
第一句子网 > SpringCloudAlibaba踩坑日记(二)Relying upon circular references is discouraged and they are prohibited by

SpringCloudAlibaba踩坑日记(二)Relying upon circular references is discouraged and they are prohibited by

时间:2019-05-07 15:53:14

相关推荐

SpringCloudAlibaba踩坑日记(二)Relying upon circular references is discouraged and they are prohibited by

文章目录

前因报错内容解决方案

前因

这俩天闲来无事想搭建一套最新版本的微服务,顺便写博客记录一下,我用的是当前时间(-04-14)最新版本

报错内容

Description:The dependencies of some of the beans in the application context form a cycle:com.alibaba.cloud.dubbo.autoconfigure.DubboLoadBalancedRestTemplateAutoConfiguration (field private com.alibaba.cloud.dubbo.metadata.repository.DubboServiceMetadataRepository com.alibaba.cloud.dubbo.autoconfigure.DubboLoadBalancedRestTemplateAutoConfiguration.repository)↓com.alibaba.cloud.dubbo.metadata.repository.DubboServiceMetadataRepository (field private com.alibaba.cloud.dubbo.service.DubboMetadataServiceProxy com.alibaba.cloud.dubbo.metadata.repository.DubboServiceMetadataRepository.dubboMetadataConfigServiceProxy)↓com.alibaba.cloud.dubbo.service.DubboMetadataServiceProxy┌─────┐| com.alibaba.cloud.dubbo.autoconfigure.DubboMetadataAutoConfiguration (field private com.alibaba.cloud.dubbo.metadata.resolver.MetadataResolver com.alibaba.cloud.dubbo.autoconfigure.DubboMetadataAutoConfiguration.metadataResolver)└─────┘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.

翻译

不鼓励依赖循环引用,默认情况下禁止使用循环引用。更新应用程序以消除bean之间的依赖循环。作为最后手段,通过设置弹簧,可能会自动中断循环。主要的允许循环引用true。

解决方案

application.properties

spring.main.allow-circular-references=true

不知道是为什么会出现这个错误,暂时只能先这么设置

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。