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

时间:2021-08-13 23:12:39   收藏:0   阅读:34

在Idea的spring工程里,经常会遇到Could not autowire. No beans of ‘xxxx‘ type found的错误提示。

技术分享图片

原因:第一个是IntellijIDEA本身工具的问题。第二个便是我们导入@Service包的时候导入包错误造成的

解决方案:

1)第一个问题解决方案:将 @Autowired 换成 @Resource

2)第二个问题解决方案:导入@Service包:import org.springframework.stereotype.Service;

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

原文:https://www.cnblogs.com/nanao/p/15138857.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!