해결된 질문
작성
·
437
1
안녕하세요 선생님.. 오류가나서요... Qualifier넣기 전까지는 테스트가 잘 돌아갔는데
Qualifier를 넣으니 NoSuchBeanDefinitionException 오류가 나는데... 왜 그런건지 잘 모르겟습니다 ㅠㅠ
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl' defined in file [D:\study\practice_again\out\production\classes\practice_again\core\order\OrderServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'practice_again.core.discount.DiscountPolicy' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value="mainDiscountPolicy")}
답변 1
1
안녕하세요. seonjun Moon님
RateDiscountPolicy 클래스에 @MainDiscountPolicy가 없습니다.
다음과 같이 추가해주세요.
@MainDiscountPolicy
public class RateDiscountPolicy
감사합니다.