Injection of autowired dependencies failed

ERROR org.springframework.web.context.ContextLoader  - Context initialization failed
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yisa.information.service.PersonService com.yisa.information.controller.SearchController.personService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.yisa.information.dao.PersonDao com.yisa.information.service.impl.PersonServiceImpl.pd; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.yisa.information.dao.PersonDao] 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)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1204)。

 
对于该错误信息,由提示直观翻译即可知道是autowired标签依赖注入失败。
出现该错误的原因是由于用于访问数据库的DAO层中Bean未定义。直白说就是xxxxDaoImpl中忘了写@Repository标签。

还有一个原因是没有在springMVC配置文件中没有将service和respository注释的包加入这里面,就是没有被Spring扫描到

org.springframework.beans.factory.annotation.Autowired(required=true)的更多相关文章

  1. springtest mapper注入失败问题解决 {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    花费了一下午都没有搜索到相关解决方案的原因,一是我使用的 UnsatisfiedDependencyException 这个比较上层的异常(在最前面)来进行搜索, 范围太广导致没有搜索到,而且即便是有 ...

  2. beans.factory.BeanCreationException beans.factory.annotation.Autowired(required=true)

    主要是这三个方面排查: 1,注入写成这样 @Autowired   private BrandServiceImpl      brandServiceImpl; 2,jar冲突,在pom.xml中 ...

  3. Java-Class-@I:org.springframework.beans.factory.annotation.Autowired

    ylbtech-Java-Class-@I:org.springframework.beans.factory.annotation.Autowired 1.返回顶部   2.返回顶部 1. pack ...

  4. Java-API-Package:org.springframework.beans.factory.annotation

    ylbtech-Java-API-Package:org.springframework.beans.factory.annotation 1.返回顶部 1. @NonNullApi @NonNull ...

  5. java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.<init>(L

    关于错误: java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.&l ...

  6. java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.<init>(Ljava/lang/Class;)V

    相应我,是因为你SPRING MVC的包没有加全.你可以新建一个WEB项目.加入SPRING 3.0 的所有包.主要是WEB类的.就可以解决这个问题了.关键就是少包.特别是你的项目原来是SRPING ...

  7. nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException

    You should autowire interface AbstractManager instead of class MailManager. If you have different im ...

  8. Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException

    1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -he ...

  9. 整合SSH时,遇到了org.springframework.beans.factory.BeanCreationException错误

    严重: StandardWrapper.Throwableorg.springframework.beans.factory.BeanCreationException: Error creating ...

随机推荐

  1. java 20 - 9 带有缓冲区的字节输出流和字节输入流

    由之前字节输入的两个方式,我们可以发现,通过定义数组读取数组的方式比一个个字节读取的方式快得多. 所以,java就专门提供了带有缓冲区的字节类: 缓冲区类(高效类) 写数据:BufferedOutpu ...

  2. 关于 app测试工具

    1. 腾讯的GT 2. testin 云测 3. monkey的自动化测试 4. 纯手工的功能测试.

  3. Android优化——UI优化(二) 使用include标签复用布局

    使用include标签复用布局 - 1.include标签的作用 假如说我下图的这个布局在很多界面都用到了,我该怎么办?每个页面都写一遍的话,代码太冗余,并且维护难度加大. <LinearLay ...

  4. ios--Attributes和ParagraphStyle介绍

    NSMutableParagraphStyle的部分属性: typedef NS_ENUM(NSInteger, NSLineBreakMode) {/* What to do with long l ...

  5. 最短路径—Dijkstra算法

    Dijkstra算法 1.定义概览 Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径.主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止.Di ...

  6. WPF SDK研究 之 AppModel

    Jianqiang's Mobile Dev Blog iOS.Android.WP CnBlogs Home New Post Contact Admin Rss Posts - 528 Artic ...

  7. The Skyline Problem

    A city's skyline is the outer contour of the silhouette formed by all the buildings in that city whe ...

  8. VS2013中BOOST库的环境配置与使用

    &1 安装Boost 文件下载:链接:http://pan.baidu.com/s/1kUKaOFP 密码:auf2 解压之后放到你想安装的文件夹内,我的是在C:\Program Files\ ...

  9. Myeclipse其实和Eclipse差不多的, 至少不输出来的项目时一模一样的

    http://zhidao.baidu.com/link?url=LiaDdzRYJtarYvpL_co-Zgno31Az7QiS0VFxGm351K3gWa225oU6-NFEfkalJB3lGV6 ...

  10. 学习笔记——Maven超级POM

    2014-07-04:更新如何在安装程序中找到超级pom文件.Maven有一个超级POM,所有的POM均继承此文件.你可以使用解压工具打开jar文件$M2_HOME/lib/maven-model-b ...