티스토리 뷰
* Spring bean 생성 시, 예외 발생 에러 해결 방법
아아....... 오늘도 붉은 색 에러 창을 마주하게 되네요 하하:-(
어쩔 수 없는 초급 개발자의 운명이랄까요ㅋㅋㅋ...
일단 스크린 샷부터 볼까요?
눈여겨 볼 곳은 파란색 부분과 제가 녹색으로 칠해놓은 부분 인데요
어떤 에러인지 어떻게 해결 할 수 있는지 알아봅시다
스크린 샷의 원문을 텍스트로 옮겨 봤습니다
영문을 번역해보니...
1월 05, 2016 10:04:47 오후 org.apache.catalina.core.ApplicationContext log
심각: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proTimetableController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.myspring.gachon.timetable.service.ProTimetableService com.myspring.gachon.timetable.controller.ProTimetableController.ProTimetableServiceImpl; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proTimetableServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.myspring.gachon.timetable.dao.ProTimetableDao com.myspring.gachon.timetable.service.ProTimetableServiceImpl.ProTimetableDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.myspring.gachon.timetable.dao.ProTimetableDao] 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)} |
Problem
Bean 생성 시 예외가 발생하여 생긴 에러 (파란색으로 색칠된 원문 참고)
현재 가천라인 프로젝트에서는 com.myspring.gachon.timetable.dao.ProTimetableDao를 사용하는데,
이 bean 객체를 찾지 못해서 발생한 에러 (녹색 진하게 색칠된 원문 참고)
Solution
나의 경우 ProTimetableDaoImpl.java를 확인 해 보니 @repository annotation 이 빠져있었다
깔끔하게 annotation 하나만 추가 해 주어 정상적으로 Dao bean 객체를 autowired 할 수 있게 되었다
Comment
솔직히 C V만 잘해도... 이런 실수는 안할 수 있을 텐데, 이런 annotation 에러는 정말 하지말자!
'Web > Error / Solution' 카테고리의 다른 글
Mapped Statements collection does not contain value for ~ error (0) | 2016.01.09 |
---|---|
Spring Tomcat 서버 구동 시 maven 에러 (10) | 2015.12.31 |
- Total
- Today
- Yesterday
- 소스코드 블로깅
- 금붕어보다 많이 나은 개발자 되고싶당
- error 분석을 철저히 하자
- Ajax
- Spring
- 나라는 닝겐
- 웹 개발자 하고시프므ㅠㅠ
- 과제 할 때 소스코드 붙여넣기
- BeanCreationException
- 스마트필
- 이거 말고 다른 방법은 뭐가 있을까요?'
- Mapped Statements collection does not contain value for
- document.getElementById().val
- 화이띵 블로거 김태수~~
- LG Business Insight
- 여가생활을 줄여야하나...
- Weekly 포커스
- .each()
- 소화 가능한 센서
- 블로그에 소스코드
- image 불러오는 방법
- IoT 시장은...?
- response
- IoT의 미래
- colorscripter.com
- 의료계의 희망!
- Dao와 mapper namespace의 호출 에러
- ./찾기 DaO bean
- 밤낮 돌리고 싶어ㅠㅠ
- 현시점에서의 IoT의 위상
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |