• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

오류

22.08.03 16:24 작성 조회수 394

0

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-08-03 16:23:18.841 ERROR 14112 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

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

┌─────┐
|  initDb defined in file [C:\Users\pkl46\OneDrive\Desktop\spring\jpashop\jpashop\out\production\classes\jpabook\jpashop\InitDb.class]
↑     ↓
|  jpabook.jpashop.InitDb$InitService
└─────┘


Action:

Despite circular references being allowed, the dependency cycle between beans could not be broken. Update your application to remove the dependency cycle.


Process finished with exit code 1

 

이런 오류가 뜨면 어느 부분을 놓친 걸까요? ㅜㅜ

답변 3

·

답변을 작성해보세요.

1

David님의 프로필

David

2022.08.03

안녕하세요. djqtdma님, 공식 서포터즈 David입니다.

InitDb와 InitService가 순환참조되었다고 나오네요. 해당 객체 생성시 양쪽 모두를 필요로 하는 상황에 발생하는 문제입니다. InitService쪽에서 InitDb를 사용하고 계신 부분이 있다면 제거해보시겠어요?

강의소스코드와 비교하셔서 다른 부분이 있는지도 확인해주세요.

감사합니다.

0

djqtdma님의 프로필

djqtdma

질문자

2022.08.03

InitDb를 그냥 복붙하였더니 해결되었습니다.

눈으로 찾지 못한 오타가 있었던 것 같습니다 ㅜㅜ

 

0

djqtdma님의 프로필

djqtdma

질문자

2022.08.03

InitDb와는 코드 비교시 다른 점이 없었어요 ㅠㅠ

강의 중에 InitService 클래스도 생성했었나요?