zoukankan      html  css  js  c++  java
  • 使用@Autowired报错Could not autowire. No beans of 'xxx' type found

    原文  https://blog.csdn.net/weixin_42209881/article/details/95312071

    我遇到的错误原因分为两种情况:
    第一种:
    注入的时候,导入的对象类路径不对,检查一下导入的路径

    import com.zhang.demo.service.IKPIDailyReportService;
    import org.apache.poi.xssf.usermodel.XSSFWorkbook;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Component;
    

    有时候有重名的类,就导致错误了,我就遇到过类似错误。
    第二种:
    也是经常遇到的,就是@Autowired的自动检测级别太高,可以使用下边的方法,或者把Error级改为提示或者警告
    在这里插入图片描述

  • 相关阅读:
    day74作业
    day072作业
    Serializer类
    day067作业
    day066作业
    day065作业
    django
    jQuery
    JavaScript
    mediaplayer state
  • 原文地址:https://www.cnblogs.com/returnZero/p/14297961.html
Copyright © 2011-2022 走看看