Idea中@Autowire提示:Could not autowire

简介: Idea中@Autowire提示:Could not autowire

IntelliJ Idea 解决 Could not autowire. No beans of ‘xxxx’ type found 的错误提示


不影响程序的编译和运行


解决办法:


  • 在注解上加上:

@Autowired(required = false)

  • 使用 @Resource 替换 @Autowired
  • 在 MyBatis 接口上加上 @Repository 注解  
  • 使用 Lombok,@RequireArgsContructor
  • 降低 Autowired 检测的级别,将 Severity 的级别由之前的 error 改成 warning 或其它可以忽略的级别。
  • 安装 MyBatis 插件
  • 构造器注入
目录
相关文章
|
Android开发
IDEA编译gradle提示This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 2020.3.1 or newer.
IDEA编译gradle提示This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 2020.3.1 or newer.
839 1
idea提示Your idea evaluation has expired. Your session will be limited to 30 minutes[亲测解决]
解决方法: 在idea中安装插件idea eval Reset,应用市场如果搜不到就安装离线的
1604 0
idea提示Your idea evaluation has expired. Your session will be limited to 30 minutes[亲测解决]
|
11月前
|
Java 数据库连接 网络安全
已解决 IDEA Maven 项目中 “Could not find artifact“ 问题的常见情况和解决方案
已解决 IDEA Maven 项目中 “Could not find artifact“ 问题的常见情况和解决方案
9149 0
|
Java Spring
2022年1月版IntelliJ Idea报错Could not autowire. No beans of ‘xxxx‘ type found的错误
2022年1月版IntelliJ Idea报错Could not autowire. No beans of ‘xxxx‘ type found的错误
|
JSON Java 数据库连接
IDEA在写Mybatis时遇到了Could not autowire. No beans of 'xxxx' type found 的错误提示
IDEA在写Mybatis时遇到了Could not autowire. No beans of 'xxxx' type found 的错误提示
208 0
IDEA提示CreateProcess error=206, 文件名或扩展名太长。
在使用IDEA运行一个测试类是,提示错误 > CreateProcess error=206, 文件名或扩展名太长。
2242 0
IDEA提示CreateProcess error=206, 文件名或扩展名太长。
IDEA的Duplicated code fragment (14 lines long)提示如何关闭
IDEA的Duplicated code fragment (14 lines long)提示如何关闭
2040 0
IDEA的Duplicated code fragment (14 lines long)提示如何关闭
idea springboot无法自动装配Could not autowire. No beans of ‘Xxx‘ type found.
idea springboot无法自动装配Could not autowire. No beans of ‘Xxx‘ type found.
idea springboot无法自动装配Could not autowire. No beans of ‘Xxx‘ type found.
|
Kubernetes Java Spring
idea配置spring: profiles提示被弃用的原因及解决办法
idea配置spring: profiles提示被弃用的原因及解决办法
idea配置spring: profiles提示被弃用的原因及解决办法
IntelliJ IDEA - 设置自动保存时间 / 提示未保存的星号 (*)
IntelliJ IDEA - 设置自动保存时间 / 提示未保存的星号 (*)
1100 0
IntelliJ IDEA - 设置自动保存时间 / 提示未保存的星号 (*)