'Is there an unresolvable circular reference? while using latest spring boot version 2.7.0
I used Springboot version 2.5.3 which works fine. Now, I upgraded the version to 2.7.0, I got the following error when I run bootRun,
Error on bootRun:
***************************
APPLICATION FAILED TO START
***************************
Description:
The dependencies of some of the beans in the application context form a cycle:
appConfigAdapter (field com.XXX.XXX.AppInterceptor com.XXX.XXX.AppConfigAdapter.appInterceptor)
↓
appInterceptor (field com.XXX.XXX.XXX.LService com.XXX.XXX.AppInterceptor.lService)
↓
lService defined in com.XXXX.Application
┌─────┐
| testService (field private com.XXX.XXX.XXX.SchemaService com.XXX.XXX.TestService.schemaService)
↑ ↓
| schemaService (field private com.XXX.XXX.TestService com.XXX.XXX.XXX.SchemaService.testService)
└─────┘
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
