Injection of autowired dependencies failed
안녕하세요 용재형 입니다. 이번 포스팅은 Injection of autowired dependencies failed 입니다.
ERROR: org.springframework.web.servlet.DispatcherServlet - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'boardController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: pay.interpay.board.service.BoardService pay.interpay.board.controller.BoardController.boardService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'boardService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: pay.interpay.board.dao.BoardDao pay.interpay.board.service.BoardService.boardDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [pay.interpay.board.dao.BoardDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
@Autowired 쓸때는 마지막 dao 단까지 잘 쓰자.
import org.springframework.stereotype.Repository;
클래스 위에 @Repository를 꼭 붙여야 함.