zoukankan      html  css  js  c++  java
  • tomcat启动报错:Injection of autowired dependencies failed

    Error creating bean with name 'backPrintPaperController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqxkzxxService com.chinauip.cfc.business.labre.lwpq.view.BackPrintPaperController.tblabrelatlwpqxkzxxService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tblabrelatlwpqxkzxxService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqxkzxxService.tblabrelatlwpqdwxxService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tblabrelatlwpqdwxxService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService.tblabrelatlwpqdwxxService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:  [com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService] 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)}

    1.检查第一个错误:tblabrelatlwpqxkzxxService类发生:Could not autowire field

    不能 private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService 

    为什么不能 autowire TblabrelatlwpqdwxxService类呢?

    2.检查第二个错误:No matching bean  ...注入失败.

    靠....原来自己把自己注入了.好吧,又是copy惹的祸.!!!!

    回复:@ Wangcaiyun

    我这里引起错误原因是 因为在类里面 自动注入了本身.
    只要把那两行代码删除就正常了.

     忘记把解决方案写出来了 

     

     
     
  • 相关阅读:
    图解排序算法(三)之堆排序
    博客园添加看板娘
    php设计模式
    PHP二维数组排序 array_multisort
    php-jwt-token
    c++实现冒泡排序
    常见的排序 转
    Mac VMware Fusion CentOS7配置静态IP
    vmwar快照和克隆区别
    springboot maven打包插件
  • 原文地址:https://www.cnblogs.com/orac/p/6207466.html
Copyright © 2011-2022 走看看