Error creating bean with name 'itemController': Injection of autowired dependencies failed; nested e
完整的错误是
Error creating bean with name 'itemController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.e3mall.service.ItemService cn.e3mall.controller.ItemController.itemService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.e3mall.service.ItemService] 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)}
----------------------------------------------------------------
Could not autowire field: private cn.e3mall.service.ItemService cn.e3mall.controller.ItemController.itemService
仔细查看发现在ItemServiceImpl中忘记加了@Service
在控制层调用业务层的时候必须现在业务层进行注解
之后才能在控制层接入业务层
如果重启后还没有解决 ,多半是代码没有及时更新同步;
F5一下 项目 就解决了
还没有评论,来说两句吧...