티스토리 뷰

Description:

 

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

 

entityManagerFactory defined in class path resource [com/example/demo/config/DatabaseConfig.class]

┌─────┐

| dataSource defined in class path resource [com/example/demo/config/DatabaseConfig.class]

↑ ↓

| routingDataSource defined in class path resource [com/example/demo/config/DatabaseConfig.class]

↑ ↓

| org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker

└─────┘

 

 

Process finished with exit code 1

 

 

** 순환참조 오류

 

DatabaseConfig.java 파일에서 Database 를 연동시켜주는 과정을 정의해놓고

Application main 에서

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

를 추가하지 않았다. 추가시켜주고 해결

 

참고

https://cnpnote.tistory.com/entry/SPRING-%EC%8A%A4%ED%94%84%EB%A7%81-%EB%B6%80%ED%8A%B8%EC%97%90%EC%84%9C-%EB%AA%A8%EB%93%A0-%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%B2%A0%EC%9D%B4%EC%8A%A4-%EA%B4%80%EB%A0%A8-%EC%9E%90%EB%8F%99-%EA%B5%AC%EC%84%B1-%ED%95%B4%EC%A0%9C

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/03   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
글 보관함