【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:
	- @org.springframework.beans.factory.annotation.Autowired(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对象实现

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>