Error creating bean with name 'itemCatController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.service.ItemCatService com.taotao.controller.ItemCatController.itemCatService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.service.ItemCatService] 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)}
今天,在開發項目的時候,遇到這個問題:Error creating bean with name 'itemCatController': Injection of autowired dependencies failed;
后來,檢查半天后發現,是在service層,少寫了一個@service,改完之后,以上錯誤不再出現。