The console outputs the following log when starting the SpringBoot project

The 2020-11-20 18:52:26. 864 WARN O.S.B.W.S.C.A nnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.concat(Ljava/lang/Iterable; Ljava/lang/Iterable;) Lcom/google/common/collect/FluentIterable; The 2020-11-20 18:52:26. 866 INFO O.S.J.E.A.A nnotationMBeanExporter - Unregistering JMX - exposed beans on shutdown in 2020-11-20 18:52:26. 867 INFO O.S.J.E.A.A nnotationMBeanExporter - Unregistering JMX - exposed beans 18:52:26. 2020-11-20 886 WARN C.N.C.S ources. URLConfigurationSource - No URLs will be polled as dynamic configuration sources. The 2020-11-20 18:52:26. 886 INFO 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. The 2020-11-20 18:52:26. 905 INFO O.S.A.R.L.S impleMessageListenerContainer - Shutdown ignored - the container is not active Already the 2020-11-20 18:52:26. 910 INFO O.A.C atalina. Core. StandardService - Stopping service [Tomcat] 2020-11-20 18:52:26. 927 WARN O.A.C.L oader. WebappClassLoaderBase - The web application (ROOT) appears to have started a thread named  [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144) com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43) Process finished with exit code 1Copy the code

According to the previous error resolution idea, usually look at the last error log, for example:

but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread
Copy the code

But, I looked for a long time did not find any reason. I thought there was a memory leak in the program I wrote, so I went to use JVM-related technology to troubleshoot the problem, and did not find the problem for a long time.

Later, there was no way out, so I continued to look up the log step by step and found a sentence:

Failed to start bean 'documentationPluginsBootstrapper' nested exception is com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.concat(Ljava/lang/Iterable; Ljava/lang/Iterable;) Lcom/google/common/collect/FluentIterable;Copy the code

Go baidu search, as expected is this problem.

The reason for this problem is that the guava version of the current project does not match it.

Check guava’s version in the project and Guava’s version in Swagger:

Sure enough, the version is different.

The solution

Swagger is the same guava version:

   <! -- <dependency> <groupId>com.google.guava</groupId> <artifactId> <version>19.0</version> </dependency>-->

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>20.0</version>
    </dependency>
Copy the code