• 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

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

     忘记把解决方案写出来了 

     

     
     
  • 相关阅读:
    BZOJ1106[POI2007]立方体大作战tet
    BZOJ4407 于神之怒加强版
    BZOJ1103: [POI2007]大都市meg
    BZOJ3170: [Tjoi2013]松鼠聚会
    Luogu 2912 [USACO08OCT]牧场散步Pasture Walking
    BZOJ1251 序列终结者- splay
    BZOJ1699: [Usaco2007 Jan]Balanced Lineup排队
    BZOJ 1005[HNOI2008]明明的烦恼
    二叉树
    [CODEVS1130]数字反转
  • 原文地址:https://www.cnblogs.com/orac/p/6207466.html
Copyright © 2020-2023  润新知