0


【ERROR o.s.b.d.LoggingFailureAnalysisReporter 错误解决方法】

ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] -

在这里插入图片描述

  1. 这里要先说明 请自行检查 @Service @Mapper等是否有问题

问题

20:27:08.374[main] ERROR o.s.b.d.LoggingFailureAnalysisReporter-[report,40]-***************************
APPLICATION FAILED TO START
***************************Description:Field remoteLogService in com.cloud.common.log.service.AsyncLogService required a bean of type 'com.cloud.system.api.RemoteLogService' that could not be found.

The injection point has the following annotations:[email protected](required=true)Action:Consider defining a bean of type 'com.cloud.system.api.RemoteLogService' in your configuration.

分析:

在这里插入图片描述
这是错误的主要原因
然后发现问题
在这里插入图片描述
然后各种文档 博客 查阅后找到
spring framerwork 4.0以后就不推荐使用属性注入,改为推荐构造器注入和setter注入,因为属性注入方式容易出现循环依赖问题;
在这里插入图片描述
其实日常使用警告很多,但被我们忽略了
解决:

1.在Application中将仅仅的@SpringBootApplication修改成:

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})

2:将@Autowired 改为 @Qualifier 进行注入或 setter方式注入

3:不使用自动注入, new对象实现

根据对应问题解决对应错误。

标签: java spring boot

本文转载自: https://blog.csdn.net/qq_15577193/article/details/127560155
版权归原作者 春风骀了谁的心 所有, 如有侵权,请联系我们删除。

“【ERROR o.s.b.d.LoggingFailureAnalysisReporter 错误解决方法】”的评论:

还没有评论