700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > SpringBoot 报错Field XXX required a bean of type XXX that could not be found.

SpringBoot 报错Field XXX required a bean of type XXX that could not be found.

时间:2022-10-20 21:10:58

相关推荐

SpringBoot 报错Field XXX required a bean of type XXX that could not be found.

场景

SpringBoot项目运行时提示:

解决

首先查看service下是否有@Service注解

这里有。

然后找到启动类

修改前:

修改后:

添加:

@SpringBootApplication(scanBasePackages = {"service","dao","config"})

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。