springboot整合knife4j/swagger报错:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-10-19 10:27:11.485 ERROR 42996 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:117)
The following method did not exist:
com.google.common.collect.FluentIterable.append(Ljava/lang/Iterable;)Lcom/google/common/collect/FluentIterable;
The method's class, com.google.common.collect.FluentIterable, is available from the following locations:
jar:file:/D:/maven/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar!/com/google/common/collect/FluentIterable.class
It was loaded from the following location:
file:/D:/maven/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.google.common.collect.FluentIterable
引起原因
guava-16.0.1.jar和swagger依赖冲突
处理办法
添加guava依赖,并指定版本
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
再次启动项目,可以正常启动
欢迎大神指导,可以留言交流!
======================
本人原创文章,转载注明出入!
=================