No matching bean of type [com.mingyi.mylibrary.service.EmpService] 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 'indexAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.mingyi.mylibrary.service.EmpService com.mingyi.mylibrary.action.IndexAction.empService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.mingyi.mylibrary.service.EmpService] 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)}
本人的异常解决:
况可能就是你的jar有冲突,本人页纠结这个问题好久,我的action中使用@autowired时,启动tomcat时总报异常,但将action中的注掉,dao跟service都是正常的,后来发现两个jar的冲突。因为一个是老版本的spring-servlet.jar,而另个是3.2版本的spring-webmvc.jar,希望对大家有帮助
分享到:
相关推荐
spring的annotation的autowired配置方法。
NULL 博文链接:https://huihai.iteye.com/blog/1880106
NULL 博文链接:https://wujiu.iteye.com/blog/2010601
java 使用Spring2.5的Autowired实现注释型的IOC
通过@Bean 和spring的factoryBean注入的bean. 以及对应@service注解注入的类 通过@Autowired 注入对象的时间是现根据类型在根据beanName获取的案例集合
主要介绍了Spring使用@Autowired为抽象父类注入依赖代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
主要介绍了Spring Boot 自定义 Shiro 过滤器无法使用 @Autowired问题及解决方法 ,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
@Autowired报Field injection is not recommended的解决办法 - 副本
Spring@Autowired注解与自动装配.rar
SSH笔记-通过@Autowired配置注入关系的demo,续上一篇文章中的annotation笔记
自定义标签中@Autowired的属性为null 解决办法:两步 1.新建一个类SpringContext,实现接口ApplicationContextAware; 2.spring.xml中添加 3.使用SpingContext.getBean("bean名");获取
autowired spring autowired注解完整版 ... 使用Spring2.5的新特性——Autowired可以实现快速的自动注入,而无需在xml文档里面添加bean的声明,大大减少了xml文档的维护。(偶喜欢这个功能,因为偶对xml不感冒)。
java web开中spring在autowired自动注入极度精简版本,绝对可以运行。博客地址: http://blog.csdn.net/qq5132834/article/details/47870351
Autowired和Resouce.txt
主要介绍了SpringBoot项目使用多线程处理任务时无法通过@Autowired注入bean问题的解决方法,需要的朋友可以参考下
主要介绍了使用@Autowired注解警告Field injection is not recommended的解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
NULL 博文链接:https://forestqqqq.iteye.com/blog/2235292
- 重构 controller 包,使用 @Autowired 装配对象 - 更新依赖 - web-mvc 对应 database-mvc - web 对应 database - 添加数据库 SQL 转储文件 ### Ver. 2.0 - 添加 web-mvc module - 新 module 使用 spring-web...
主要介绍了详解Spring Controller autowired Request变量的相关资料,通过此文希望能帮助到大家,需要的朋友可以参考下