Description:
The dependencies of some of the beans in the application context form a cycle:
┌──->──┐
| keycloakConfig (field private org.keycloak.adapters.KeycloakConfigResolver
org.keycloak.adapters.springsecurity.config.KeycloakWebSecurityConfigurerAdapter.keycloakConfigResolver)
└──<-──┘
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.
이런 오류가 떴다.
그리고 서버 안켜짐
콘솔에 뜬대로
spring:
application:
name: user-service
main:
allow-circular-references: true
spring.main.allow-circular-references를 true로 해주면 된다.
이제 잘 켜진다
Circular reference 생기는 건 사실 좋지 않은 증상이라, 코드가 잘못된 건지 한번 확인해보세요. 원칙적으로 circular reference는 생기면 안되는겁니다!