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
不知道是为什么会出现这个错误,暂时只能先这么设置
相关文章
|
人工智能 Java Spring
Spring Boot循环依赖的症状和解决方案
Spring Boot循环依赖的症状和解决方案
|
7月前
|
搜索推荐 Shell
bpmn-js打造最强flowable流程设计器
在企业系统中,流程引擎至关重要。Flowable虽强大,但默认设计器功能有限。本文基于 bpmn-js 打造增强版 Flowable 设计器,支持丰富自定义属性与后端联动。bpmn-js 优势明显:原生支持 BPMN 2.0、可扩展性强、社区活跃。节点涵盖多种事件、任务、网关等,满足复杂业务需求。示例效果可见在线预览。
|
搜索推荐 Java 开发者
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
【5月更文挑战第14天】org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
5336 1
|
Kubernetes Java Linux
Linux|操作系统|Error: Could not create the Java Virtual Machine 报错的解决思路
Linux|操作系统|Error: Could not create the Java Virtual Machine 报错的解决思路
3720 0
|
缓存 Java 微服务
Springboot微服务整合缓存的时候报循环依赖的错误 两种解决方案
Springboot微服务整合缓存的时候报循环依赖的错误 两种解决方案
424 1
|
12月前
|
SpringCloudAlibaba JavaScript Dubbo
【SpringCloud Alibaba系列】Dubbo dubbo-admin安装教程篇
本文介绍了 Dubbo-Admin 的安装和使用步骤。Dubbo-Admin 是一个前后端分离的项目,前端基于 Vue,后端基于 Spring Boot。安装前需确保开发环境(Windows 10)已安装 JDK、Maven 和 Node.js,并在 Linux CentOS 7 上部署 Zookeeper 作为注册中心。
3474 1
【SpringCloud Alibaba系列】Dubbo dubbo-admin安装教程篇
完美解决Non-terminating decimal expansion; no exact representable decimal result.异常
完美解决Non-terminating decimal expansion; no exact representable decimal result.异常
27270 0
完美解决Non-terminating decimal expansion; no exact representable decimal result.异常
|
Java Maven
【Maven】下载配置maven以及IDEA配置maven详情
【Maven】下载配置maven以及IDEA配置maven详情
2248 0
|
Java 数据库连接 Spring
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could
这个错误通常出现在使用Spring Boot进行数据库连接时。错误信息表明Spring Boot未能配置一个DataSource,因为没有指定'url'属性,并且没有发现默认的数据库连接。
5923 0
|
Java Linux Windows
记一次排查循环依赖的经历
记一次排查循环依赖的经历