После того, как SpringBoot интегрирует swagger, появляется: Не удалось запустить решение bean 'documentationPluginsBootstrapper'
2020-11-20 18:52:26.864 WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - 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;
2020-11-20 18:52:26.866 INFO o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown
2020-11-20 18:52:26.867 INFO o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans
2020-11-20 18:52:26.886 WARN c.n.c.sources.URLConfigurationSource - No URLs will be polled as dynamic configuration sources.
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.
2020-11-20 18:52:26.905 INFO o.s.a.r.l.SimpleMessageListenerContainer - Shutdown ignored - container is not active already
2020-11-20 18:52:26.910 INFO o.a.catalina.core.StandardService - Stopping service [Tomcat]
2020-11-20 18:52:26.927 WARN o.a.c.loader.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 1
Согласно предыдущему размышлению об устранении ошибки, часто нужно посмотреть последний журнал ошибок, например:
but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread
Однако я долго искал и не мог найти никакой причины. Я думал, что в программе, которую я написал, была утечка памяти, поэтому я использовал технологии, связанные с JVM, для устранения проблемы, и спустя долгое время я не обнаружил никаких проблем.
Позже у меня действительно не было выбора, поэтому я продолжал смотреть на шаг за шагом и нашел предложение:
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;
Перейти к поиску Baidu, это действительно проблема.
Причина этой проблемы:当前项目的guava版本与之不匹配
.
Перейдите, чтобы проверить версию гуавы в проекте и версию гуавы в swagger:
Версии конечно разные.
Измените его на ту же версию guava, что и swagger:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>