Failed to start bean ‘documentationPluginsBootstrapper‘,引入swagger时guava报错

Failed to start bean ‘documentationPluginsBootstrapper
报错详情

2020-10-12 10:31:27.880  WARN 12548 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.append(Ljava/lang/Iterable;)Lcom/google/common/collect/FluentIterable;
2020-10-12 10:31:27.903  WARN 12548 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2020-10-12 10:31:27.903  INFO 12548 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-10-12 10:31:27.907  INFO 12548 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'tpAsyncLogFileExecutor'
2020-10-12 10:31:27.914  INFO 12548 --- [           main] com.netflix.discovery.DiscoveryClient    : Shutting down DiscoveryClient ...
2020-10-12 10:31:27.917  INFO 12548 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CIM-CI/DESKTOP-UHNEPQU:cim-ci:8202 - registration status: 204
2020-10-12 10:31:27.918  INFO 12548 --- [           main] com.netflix.discovery.DiscoveryClient    : Unregistering ...
2020-10-12 10:31:27.970  INFO 12548 --- [           main] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CIM-CI/DESKTOP-UHNEPQU:cim-ci:8202 - deregister  status: 200
2020-10-12 10:31:27.980  INFO 12548 --- [           main] com.netflix.discovery.DiscoveryClient    : Completed shut down of DiscoveryClient
2020-10-12 10:31:27.981  INFO 12548 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-10-12 10:31:28.075  INFO 12548 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-10-12 10:31:28.085 ERROR 12548 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method com.google.common.collect.FluentIterable.append(Ljava/lang/Iterable;)Lcom/google/common/collect/FluentIterable; but it does not exist. Its class, com.google.common.collect.FluentIterable, is available from the following locations:

    jar:file:/E:/maven3.6.3/mavenRepo/repository/com/google/guava/guava/15.0/guava-15.0.jar!/com/google/common/collect/FluentIterable.class

It was loaded from the following location:

    file:/E:/maven3.6.3/mavenRepo/repository/com/google/guava/guava/15.0/guava-15.0.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of com.google.common.collect.FluentIterable

使用swagger2出现这个异常,百度后发现这个问题是因为swagger依赖google的guava,而你当前项目的guava版本与之不匹配,而我因为使用当前最新的swagger2版本,我就将guava升到最新的版本,pom文件修改如下即可

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>25.1-jre</version>
		</dependency>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值