JAVAIARY

org.springframework.beans.factory.UnsatisfiedDependencyException 오류 본문

selfEdu/극약처방 ) Error

org.springframework.beans.factory.UnsatisfiedDependencyException 오류

shiherlis 2022. 12. 19. 17:50

1. 문제 : 빌드가 안돼서 오류가 뜸   

2.원인 

Context initialized 이벤트를 [org.springframework.web.context.ContextLoaderListener] 클래스의 인스턴스인 리스너에 전송하는 동안 예외 발생
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customUserDetailsService': Unsatisfied dependency expressed through method 'setMemberMapper' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'kr.co.springsecurity.member.MemberMapperInterface' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:767)

MemberMapperInterface 에 @Repository annotation을 작성해 주지 않아서 의존성 주입이 안됨

3. 해결

@ Repository annotation 추가로 해결