幫忙分析原因 Error creating bean with name 'fireNewsAnalyseServiceImpl': Unsatisfied dependency expressed through field 'mcnNewsClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'feignLoggerFactory' defined in org.springframework.cloud.openfeign.FeignClientsConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.openfeign.FeignLoggerFactory]: Factory method 'feignLoggerFactory' threwexception; nested exception is java.lang.NoClassDefFoundError: feign/slf4j/Slf4jLogger
时间: 2023-08-14 15:37:43 浏览: 167
这个错误的主要原因是应用程序缺少Feign依赖或者Feign依赖的版本与slf4j依赖的版本不匹配。您可以尝试在应用程序中添加适当的Feign和slf4j依赖项,并确保它们的版本匹配。
在您的情况下,看起来是缺少了 `feign-slf4j` 依赖项,可以尝试在项目中添加以下依赖项:
```xml
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
<version>11.3</version>
</dependency>
```
或者在 Gradle 中添加以下依赖项:
```groovy
implementation 'io.github.openfeign:feign-slf4j:11.3'
```
如果问题仍然存在,可以尝试升级或降级slf4j依赖版本,或者通过排除依赖项来解决冲突问题。例如,在Maven中可以这样排除或者替换slf4j依赖:
```xml
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
<version>11.3</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <!-- 替换slf4j依赖 -->
<version>1.7.30</version>
</dependency>
```
希望以上信息能够帮助您解决问题。
阅读全文