IDEA使用—報錯 Could not autowire. No beans of ''XXXXX" type found.

紅線的報錯內容:

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是把√去掉)
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章