用service来取数据时报错,错误如下:
Unable to instantiate Action, com.assistant.action.CommenAction, defined for 'index' in namespace '/'Error creating bean with name 'com.assistant.action.CommenAction': Injection of resource methods failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.assistant.service.ITabooService] is defined: Unsatisfied dependency of type [interface com.assistant.service.ITabooService]: expected at least 1 matching bean
原因是我在新建一个类后再写dao和service层时忘了加@Component,以至spring不能成功注入,粗心大意害死猿啊!