Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
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
Tags
more
Archives
Today
Total
관리 메뉴

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 붙혀서 해결