728x90
Exception in thread "main" org.springframework.beans.factory.NoUniqueBeanDefinitionException
https://github.com/codestates-seb/agora-states-be/discussions/95
Exception in thread "main" org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'upqnu.umarket.user.UserService' available: expected single matching bean but found 2: userServiceImpl,userService
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1271)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:494)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:349)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
at upqnu.umarket.AppConfigTest.main(AppConfigTest.java:14)
expected single matching bean but found 2: userServiceImpl,userService
AppConfig에서 @Bean과 @Component를 동시에 적어서 나는 문제
같은 타입의 빈을 두번 생성하라고 해서 오류가 난 것이다
728x90
'Java & Spring > Error' 카테고리의 다른 글
| [에러해결] SpringBoot 중 Lombok문제 (0) | 2022.08.16 |
|---|---|
| [에러해결] finished with non-zero exit value 1 (0) | 2022.08.16 |
| [에러해결] 값 비교 (.equals / == ) (0) | 2022.08.12 |
| [에러해결] Spring - not a regular file 에러 (0) | 2022.08.09 |
| [에러해결] 람다식 / Arrays.toString(event) / 문자열 비교 (0) | 2022.08.02 |