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

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

     忘记把解决方案写出来了 

     

     
     
  • 相关阅读:
    mysql "ON DUPLICATE KEY UPDATE" 语法
    HTTP协议中PUT和POST使用区别
    layui 表单渲染失败
    golang 一行代码 把array/slice转成逗号分隔的字符串
    关于layui、table数据表格请求异常回调函数
    关于layui表单中按钮自动提交的解决方法
    使用 socket.io 报错 Error during WebSocket handshake: Unexpected response code: 400
    解决MySQL报错:[Err] 1055
    jetbrains 修改 http proxy 更换代理
    layui layuiadmin layui.data 数据操作
  • 原文地址:https://www.cnblogs.com/orac/p/6207466.html
Copyright © 2011-2022 走看看