搜索
简帛阁>技术文章>项目引入 swagger 启动报错处理(An attempt was made to call the method com.google.common.collect.FluentIterable)

项目引入 swagger 启动报错处理(An attempt was made to call the method com.google.common.collect.FluentIterable)

背景介绍

我用的springboot框架,是用maven构建的项目,加入swagger依赖的时候启动的时候报错

报错信息:

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

Description:

An attempt was made to call the method com.google.common.collect.FluentIterable.concat(Ljava/lang/Iterable;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:/repository/com/google/guava/guava/19.0/guava-19.0.jar!/com/google/common/collect/FluentIterable.class

It was loaded from the following location:

    file:/repository/com/google/guava/guava/19.0/guava-19.0.jar


Action:

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


Process finished with exit code 0

定位原因:

根据错误定位是jar包冲突,

1、执行maven命令查看项目jar包依赖关系

mvn dependency:tree >tree.log

2、依赖引用分析发现有多个地方引用了guava

--nacos-client

--swagger

解决方案:

在启动项目模块中pom.xml 指定guava版本,重新启动项目。

         <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>29.0-jre</version>
        </dependency>

 

 

启动tomcat7之后,运行正常,但是运行一段时间就会提示以下警告:十二月04,20135:10:15下午orgapachecatalinarealmLockOutRealmauthenticateW
今天早上启动Nginx,在错误日志中输出如下错误信息:2022/01/2809:23:22[emerg]1278420692:bind()to0000:7098failed(10013:Anatte
nginx的errorlog日志错:2018/01/2511:55:22[emerg]338015488:bind()to0000:20003failed(10013:Anattemptwasmad
问题描述:启动Azkaban错:javalangNoSuchMethodError:comgooglecommoncollectImmutableMaptoImmutableMap解决方法:从报错信
文章目录项目场景:问题描述:原因分析:解决方案:项目场景:系统:Ubuntu2004Hadoop版本:Hadoop331Hbase版本:Hive312问题描述:在启动Hive时,出现如下输出:had
1google工具jarimportcomgooglecommoncollectLists;importcomgooglecommoncollectMaps;//ArrayList<Object
打开server窗口,发现显示:Couldnotcreatetheview:Anunexpectedexceptionwasthrown此处解决方法:关闭myeclipse删除文件workspace/
错如下:[2041117:42:48:264CST]0000000eRoleViewLeadeIDCSV8030I:在成员vmu208119Cell01\vmu208119AppNode01\vm
HowtoTalktotheEmergencyDispatcher[minutesmatterupmc稻糠亩]HowToCallAnAmbulance[askambulance稻糠亩]1Takeade
一、问题描述打开myclipse,发现server窗口错,Couldnotcreatetheview:Anunexpectedexceptionwasthrown。二、解决这是由于之前被部署到to