인프런 커뮤니티 질문&답변
UnsatisfiedDependencyException:
작성
·
538
0
public void basicScan()을 붙이고 시행 했는데 다음과 같은 에러가 났습니다.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl' defined in file [D:\core\out\production\classes\hello\core\order\OrderServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'hello.core.discount.DiscountPolicy' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier("mainDiscountPolicy")}
어덯게 수정해야 하나요?
퀴즈
필드 주입(Field Injection) 방식이 일반적으로 권장되지 않는 이유는 무엇일까요?
불변성을 보장하기 어려워서
의존성 변경이 쉬워서
순수 Java 코드로 테스트하기 어려워서
설정 코드 작성이 복잡해서
답변 1
0





