解决IDEA中 Could not autowire. No beans of ‘xxxx‘ type found 的错误提示

https://developer.aliyun.com/article/841316

简介: 解决IDEA中 Could not autowire. No beans of ‘xxxx’ type found 的错误提示

在这里插入图片描述
近段时间,转到IDEA来开发公司项目。但是经常会出现Could not autowire. No beans of ‘xxxx’ type found的错误提示。
这个错误提示并不会产生影响,程序的编译和运行都是没有问题的。
但是对于强迫症而言,红色的错误提示是不可容忍的。所以开始着手解决

1)不管他

表示强迫症真的是受不了

2) 修改注解

@Autowired(required = false)

3) 使用@Resource注解

@Resource

4) 修改IDEA配置

修改IDEA设置,降低Autowired检测的级别,将Severity的级别由之前的error改成warning或其它可以忽略的级别。
在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"Could not autowire. No beans of 'JieConfigurationService' type found." 这个错误提示通常出现在Spring框架,表示在注入依赖时找不到对应的bean。这可能是由于以下几个原因导致的: 1. 没有在Spring容器声明或配置 'JieConfigurationService' bean。请确保在配置文件或使用注解的方式正确配置了该bean。 2. 'JieConfigurationService' bean 配置的名字与注入注解引用的名字不一致。请检查注入的代码,确保注解的名字与bean的名字一致。 3. 依赖包或类文件缺失。检查是否缺少了引用 'JieConfigurationService' 类的依赖包或者类文件。确保该类在编译时可以被正确找到。 综上所述,要解决这个问题,你需要检查以下几个方面:确认 'JieConfigurationService' bean 已经在Spring容器正确配置,并且注解引用的名字与配置的名字一致。同时,确保依赖包和类文件都存在并被正确引入。这样,你应该能够解决 "Could not autowire. No beans of 'JieConfigurationService' type found." 的错误提示。 #### 引用[.reference_title] - *1* *2* [Could not autowire. No beans of ‘XXX‘ type found](https://blog.csdn.net/weixin_44096133/article/details/128679145)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [Idea 解决 Could not autowire. No beans of 'xxxx' type found 的错误提示](https://download.csdn.net/download/weixin_38632624/12751965)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值