笔记(此次问题忘记截图):运行过程提示说(应用程序上下文中某些bean的依赖关系形成一个循环)

出现如下描述:

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

   todoController (field private com.xm.service.TodoService com.xm.controller.TodoController.todoService)
┌─────┐
|  todoService (field private com.xm.service.TodoService 

com.xm.service.TodoService.todoMapper)

注意:它会提供处理方法(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)进行设置

spring.main.allow-circular-references: true

如图:

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐