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)}
在做淘淘商城的过程中遇到ItemCatService没有找到对应的依赖dependency,去查找问题是在实现类中少了@Service这个注解,导致项目启动时,在controller层 @Autowired private ItemCatService itemCatService; 注入的接口没有找到依赖关系,只需在实现类添上@Service注解即可。