ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberController' defined in file
[C:\Users\LG677\Documents\workspace-sts-3.9.14.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Final_관통_Trip_김성수_박세정\WEB-INF\classes\com\sungsu\board\member\controller\MemberController.class]:
Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'memberServiceImpl' defined in file
[C:\Users\LG677\Documents\workspace-sts-3.9.14.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Final_관통_Trip_김성수_박세정\WEB-INF\classes\com\sungsu\board\member\model\service\MemberServiceImpl.class]:
Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'com.sungsu.board.member.model.mapper.MemberMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
classpath 문제인가? no, classpath 확인해봤는데 resources가 잘 등록되어 있음.
xml 설정 문제인가? 패키지 경로 컴포넌트 스캔 해줬는데 안됨.
진짜 모르겠다.. 애초에 경로를 생성할 때부터 문제가 생긴건지..
그러면 Controller에서는 Service를 빈주입받지 못한 것이고, Service에서는 Mapper를 빈주입받지 못하고 있는 상황.
결국 Mapper를 빈 주입하지 못하는게 가장 큰 원인이다.
root-cotext.xml에 mybatis-spring:scan 태그를 추가해주지 않고 있었다..
빈 주입이 안되는데 xml 때문인건 알고 있었는데.. (진짜 꼼꼼하게 볼걸, 스스로에게 확신이 없었다.. 스프링 빈 주입 문제를 처음 해결해보는 거여서.. 다음엔 엄청 빨리 해결할 수 있을 듯?) 이거 해결하는데 하루가 걸리다니...!!! 말도안돼..
그래도 긍정적인건 이 에러를 해결하면서 xml 구조를 더 잘 파악할 수 있게 되었다는 사실! 오히려 좋아