
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled. 2021-12-29 22:52:35.557 ERROR [cloud-payment-service,,,] 13720 — [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
*************************** APPLICATION FAILED TO START ***************************
Description:
A component required a bean of type ‘com.xxx.xxx.dao.PaymentDao’ that could not be found.
Action:
Consider defining a bean of type ‘com.xxx.xxx.dao.PaymentDao’ in your configuration.
Process finished with exit code 0

解决方法:
这里报错是因为我的dao层的bean没有被spring扫到,这时候第一反应就是去看看自己的dao层是否添加对应的注解。

如图:我的已经添加了对应的Mapper注解但是还是扫描不到,然后在自己的启动类上添加

@ComponentScan(basePackages = {"com.lzh.cloudstudy.dao"})
然后就解决了这一层没法被扫到的错误。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/193129.html原文链接:https://javaforall.cn