인프런 커뮤니티 질문&답변

좋은사람님의 프로필 이미지
좋은사람

작성한 질문수

스프링 프레임워크는 내 손에 [스프1탄]

80.회원인증 적용 게시판 수정하기

org.springframework.beans.factory.UnsatisfiedDependencyException

작성

·

265

0

MVC06 소스 톰캣 실행 시 아래 오류가 발생합니다.

 

ERROR: org.springframework.web.servlet.DispatcherServlet - Context initialization failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberController': Unsatisfied dependency expressed through field 'memberUserDetailsService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'kr.ody.apps.security.MemberUserDetailsService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586)

at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1344)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)

 

구글링으로 파악이 안되네요.

원인이 무엇일까요?

답변 1

0

좋은사람님의 프로필 이미지
좋은사람
질문자

자답

 

@Controller

public class MemberController {

@Autowired

MemberMapper memberMapper;

@Autowired(required=false) // required를 false로 하여 주입 안받아도 예외처리 하지 않도록 함.

MemberUserDetailsService memberUserDetailsService;

좋은사람님의 프로필 이미지
좋은사람

작성한 질문수

질문하기