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

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

@[toc]

前因

这俩天闲来无事想搭建一套最新版本的微服务,顺便写博客记录一下,我用的是当前时间(2022-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
不知道是为什么会出现这个错误,暂时只能先这么设置
相关文章
|
7月前
|
搜索推荐
Angular 依赖注入错误消息:ERROR Error NullInjectorError No provider for XX
Angular 依赖注入错误消息:ERROR Error NullInjectorError No provider for XX
39 0
|
6月前
|
Web App开发 前端开发 JavaScript
Angular 应用实现 Lazy Load(懒加载)的项目实战经验分享
Angular 应用实现 Lazy Load(懒加载)的项目实战经验分享
52 0
|
7月前
|
UED
Angular 中 Lazy Loading 的陷阱与最佳实践
Angular 中 Lazy Loading 的陷阱与最佳实践
40 0
|
11月前
|
JavaScript 前端开发
每天3分钟,重学ES6-ES12(十八)ES Module(一)
每天3分钟,重学ES6-ES12(十八)ES Module
55 0
|
11月前
|
JavaScript 前端开发
每天3分钟,重学ES6-ES12(十八)ES Module(二)
每天3分钟,重学ES6-ES12(十八)ES Module
55 0
|
11月前
Cannot build artifact ‘SSM模板+登录注册:war exploded‘ because it is included into a circular dependency (a
Cannot build artifact ‘SSM模板+登录注册:war exploded‘ because it is included into a circular dependency (a
77 0
|
Web App开发 JavaScript 前端开发
VS Code 折腾记 - (7) 内置Debug功能深入(调教angular-cli )
很多小伙伴说用了打包工具(Webpack)之后,断点调试有点麻烦(需要借助sourcemap); 常规的方式无非是debugger,console.log()大法; 但是,VS Code这货天生支持Debug功能,不用白不用,今天我就说说怎么调教angular-cli;
335 0
|
资源调度 JavaScript 测试技术
Angular 2.x折腾记 :(1)初识Angular-cli[官方脚手架]及脱坑要点
这个系列的进度有些跳跃性,我尽量直白点解释,但是我不是官方文档,直入主题!!!!
140 0
|
存储 算法 JavaScript
ES6躬行记(16)——Set
  ES6引入了两种新的数据结构:Set和Map。Set是一组值的集合,其中值不能重复;Map(也叫字典)是一组键值对的集合,其中键不能重复。Set和Map都由哈希表(Hash Table)实现,并可按添加时候的顺序枚举。
Angular应用启动时创建的injection token一览
Angular应用启动时创建的injection token一览
113 0
Angular应用启动时创建的injection token一览