ordinary
Parameter 1 of constructor in 패키지 required a single bean, but 2 were found: 본문
카테고리 없음
Parameter 1 of constructor in 패키지 required a single bean, but 2 were found:
extra_ 2022. 12. 2. 08:00- 컴파일단계에서 나는 오류
친절하게
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
요렇게 저렇게 하라고 알려준다.
bean등록 오류인데
@Component로 등록해뒀던 클래스를 Config파일에서 다시 생성해서 쓰려고 @Bean을 붙혀서 두번 bean이 등록되어 발생한 오류였다.
-> 해결방법 : 에러로그에 경로 파일을 둘다 열어보고 두 파일에 등록된 bean 중에 하나의 bean 등록 해제
or
콘솔에서 알려준대로 둘중 하나에 @Primary 나 @Qualifier 붙혀서 해결