이슈
DatabaseConfig-A
-> @Primary 설정
DatabaseConfig-B
-> @Primary 설정 없음
DatabaseConfig-B 에 설정한 Mapper에서 에러 발생
Invalid bound statement (not found): com.xxx.mapper.xxxMapper.select
원인
@MapperScan의 basePackages 가 중복됐던 것.
해결
DatabaseConfig-A 설정 변경
변경 전
@MapperScan(basePackages="com.my.mapper.*"
변경 후
@MapperScan(basePackages="com.my.mapper.aaa"
각 DB별 MapperScan의 basePackages 를 구체적으로 설정해주니 해결되었다.
참고
이 분은 다른 방법으로 해결하셨으니 참고하시게.
https://okky.kr/questions/867676
이분은 오타이셨다네.
https://www.cnblogs.com/aaacarrot/p/17007647.html
'Spring' 카테고리의 다른 글
[JPA] BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource~ (0) | 2023.08.06 |
---|---|
[Swagger] Springdoc-openapi Cors 에러 해결 방법 (1) | 2023.07.16 |
[Spring] @PostConstruct 사용 후 다른 클래스에서 호출 방법 (0) | 2022.12.20 |
[Spring][Error] Could not bind properties to 'SecurityProperties' (0) | 2022.05.02 |
[인프런][김영한] 스프링 입문 강의 내용 정리(작성중) (0) | 2022.03.30 |