* Spring bean »ý¼º ½Ã, ¿¹¿Ü ¹ß»ý ¿¡·¯ ÇØ°á ¹æ¹ý
* 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 ¿¡·¯´Â Á¤¸» ÇÏÁö¸»ÀÚ!
Ãâó: https://ceaserdev.tistory.com/entry/Spring-BeanCreationException-¿¡·¯-ÇØ°á-¹æ¹ý [°³¹ß ½Å¿¡°Ô º¸¿©ÁÙ °³¹ßÀÚ ³ëÆ®]