红线的报错内容:
Could not autowire. No beans of ‘RestTemplate’ type found. more… (Ctrl+F1)
如图:

解决方法:在 Intellij Idea中设置一下:
Settings - Editor - Inspections - Spring - Spring Core - Code - Autowiring for Bean Class - disable(idea2017是把√去掉)

本文介绍了解决在IntelliJ IDEA中遇到的RestTemplate自动注入失败问题的方法。通过在设置中禁用Spring核心代码自动装配检查,可以避免IDE显示红线错误提示,确保项目正常运行。
红线的报错内容:
Could not autowire. No beans of ‘RestTemplate’ type found. more… (Ctrl+F1)
如图:

解决方法:在 Intellij Idea中设置一下:
Settings - Editor - Inspections - Spring - Spring Core - Code - Autowiring for Bean Class - disable(idea2017是把√去掉)

4564

被折叠的 条评论
为什么被折叠?