报错:

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

BProjectController (field private com.jianke.tree.service.BProjectService com.jianke.tree.controller.BProjectController.projectService)

BProjectServiceImpl (field private com.jianke.tree.service.ISysOrganizationTreeService com.jianke.tree.service.impl.BProjectServiceImpl.iSysOrganizationTreeService)
┌─────┐
| sysOrganizationTreeServiceImpl (field private com.jianke.tree.service.BCompanyService com.jianke.tree.service.impl.SysOrganizationTreeServiceImpl.bCompanyService)
↑ ↓
| BCompanyServiceImpl (field private com.jianke.tree.service.ISysOrganizationTreeService com.jianke.tree.service.impl.BCompanyServiceImpl.sysOrganizationTreeService)
└─────┘


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.yml或bootstrap.yml中,这里有个坑:nacos下配置无效需要在项目中的yml中配置。

spring:
main:
allow-circular-references: true