Could not autowire. No beans of 'RestTemplate' type found. more...

一.问题描述:

    今天在springboot项目中构建配置类时报错

    

二.问题分析:

   经网上查询得知, idea的纠错机制在解析spring通过命名约定的方式进行配置时,支持的并不是太好,而用Autowired或Resource注入bean时,会报错。

三.问题解决:

   我使用Resource注入后,问题解决

发布了193 篇原创文章 · 获赞 30 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/yiye2017zhangmu/article/details/97618748