bug解决_{@org.springframework.beans.factory.annotation.Autowired(required=true)}
2017-11-27 21:08
567 查看
问题:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'itemsController':
Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Could not autowire field: private com.itheima.springmvc.service.ItemsService com.itheima.springmvc.controller.ItemsController.itemsService;
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [com.itheima.springmvc.service.ItemsService] 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)}
原因:没有加载spring核心配置文件
解决:在web.xml里面添加applicationContext.xml相关配置就解决了
相关文章推荐
- mapper注入失败问题解决 {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- SSM整合单元测试出错@org.springframework.beans.factory.annotation.Autowired(required=true)}
- Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)
- Spring异常: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- springmcv 整合shiro报{@org.springframework.beans.factory.annotation.Autowired(required=true)}
- 报错:Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- 异常:org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
- org.springframework.beans.factory.BeanNotOfRequiredTypeException的解决办法
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException
- beans.factory.BeanCreationException beans.factory.annotation.Autowired(required=true)
- Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.Be
- beans.factory.BeanCreationException beans.factory.annotation.Autowired(required=true)