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对象实现

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

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐