spring
The dependencies of some of the beans in the application context form a cycle: 오류
tonirr
2020. 5. 19. 14:38
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})
를 추가하지 않았다. 추가시켜주고 해결
참고