【JAVA】Intelij IDEA 使用笔记——Could not autowire. No beans of 'xxxx' type found的错误提示

待补充……

  ——安装SVN:

    IDEA的SVN(Subversion)使用时,需要先【Add to VCS(可能是我新建class的时候没有add to vcs)】再【Commit file(提交)】;

    更新工程是【Update file】;

  ——安装tomcat 8;

  ——Navicat:辅助用于查看数据库MySQL的结构;

======================================================

【1】Autowired注解

【IntelliJ Idea解决Could not autowire. No beans of 'xxxx' type found的错误提示】

  该错误的原因主要是两种:

  1)把依赖包写错了;解决方案是导入正确的包。

  别人给出的常常被导入错误的包,如下所示:

  import com.alibaba.dubbo.config.annotation.Service;

  正确的包应该是这个
  import org.springframework.stereotype.Service;

  不过,我应该不是这个问题。

  So,继续看。

  2)软体版本问题;

  版本问题的解决方法是暴力解决,即将error提示降级为warning……

  具体操作:Settings -> Inspections -> Spring -> Spring Core -> Code -> Autowiring for Bean Class,将红色的error降级为黄色warning。【简单粗暴】

  出问题的时候 我使用的是2017.2版本的Intellij IDEA,其他人都用2018版本。。。所以应该是版本问题吧。实在懒得重新安装2018版【毕竟马上2019了噗】

【参考】

https://blog.csdn.net/u012453843/article/details/54906905

======================================================

猜你喜欢

转载自www.cnblogs.com/anno-ymy/p/10144121.html
今日推荐