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

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

绿林寻猫
2021-12-08 / 1 评论 / 1,431 阅读 / 正在检测是否收录...

SpringBoot多数据源启动项目报错:

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

Description:

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

   sysJobController (field private com.comet.service.ISysJobService com.comet.controller.SysJobController.sysJobService)
      ↓
   sysJobServiceImpl (field private com.comet.mapper.SysJobMapper com.comet.service.impl.SysJobServiceImpl.sysJobMapper)
      ↓
   sysJobMapper defined in file [G:\IdeaProject\comet\comet-quartz\target\classes\com\comet\mapper\SysJobMapper.class]
      ↓
   sqlSessionFactory defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]
┌─────┐
|  dynamicDataSource defined in class path resource [com/comet/config/DataSourceConfig.class]
↑     ↓
|  masterDataSource defined in class path resource [com/comet/config/DataSourceConfig.class]
↑     ↓
|  org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker
└─────┘

解决方式:

在启动类添加

(exclude = { DataSourceAutoConfiguration.class })

 

0

评论 (1)

取消
  1. 头像
    山人
    Windows 10 · Google Chrome

    你好,请问您的最新文章王者荣耀战绩查询那个,隐藏战绩能查询到吗?

    回复