[spring boot 오류해결] The dependencies of some of the beans in the application context form a cycle:

뿌이·2022년 3월 7일
1

오류해결

목록 보기
20/53
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.

이런 오류가 떴다.
그리고 서버 안켜짐

콘솔에 뜬대로

application.yml

spring:
  application:
    name: user-service
  main:
    allow-circular-references: true

spring.main.allow-circular-references를 true로 해주면 된다.
이제 잘 켜진다

profile
기록이 쌓이면 지식이 된다.

2개의 댓글

comment-user-thumbnail
2022년 12월 8일

Circular reference 생기는 건 사실 좋지 않은 증상이라, 코드가 잘못된 건지 한번 확인해보세요. 원칙적으로 circular reference는 생기면 안되는겁니다!

답글 달기
comment-user-thumbnail
2023년 4월 14일

안녕하세요. Relying upon circular references 이라고 시작되는거 보니 저 경우 보통 순환참조가 일어날 때 많이 일어는 것 같은데 한 번 확인해주실 수 있으실까요? 궁금하네요!

답글 달기