강의

멘토링

커뮤니티

Inflearn Community Q&A

sunjune18284435's profile image
sunjune18284435

asked

Spring Core Principles - Basic Edition

@Autowired Field Name, @Qualifier, @Primary

안녕하세요 선생님.. 오류가...ㅠㅠ

Resolved

Written on

·

497

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")}

springoop

Answer 1

1

yh님의 프로필 이미지
yh
Instructor

안녕하세요. seonjun Moon님

RateDiscountPolicy 클래스에 @MainDiscountPolicy가 없습니다.

다음과 같이 추가해주세요.

@MainDiscountPolicy

public class RateDiscountPolicy

감사합니다.

sunjune18284435's profile image
sunjune18284435

asked

Ask a question