Обновлена ​​весенняя загрузка с 2.1.0 до 2.2.2. RELEASE, теперь получая исключение при запуске - PullRequest
0 голосов
/ 08 января 2020

Я обновил SpringBoot версии 2.1.0 до 2.2.2.RELEASE

java: openjdk11 spring-boot: v2.2.0.RELEASE springCloudВерсия: Hoxton.RC1

Ошибка:

Приложение не удалось запустить

Описание:

Была предпринята попытка вызвать метод, который не существует. Попытка была сделана из следующего местоположения:

springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder (DocumentationPluginsManager. java: 152)

Выполнен следующий метод не существует:

 org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang> /Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;

Класс метода org.springframework.plugin.core.PluginRegistry доступен в следующих местах:

jar:file:/home/cuelogic.local/kanisha.modi/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class

Он был загружен из следующего местоположения:

file:/home/cuelogic.local/kanisha.modi/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar

Действие:

Исправьте путь к классу приложения, чтобы он содержит одну совместимую версию org.springframework.plugin.core.PluginRegistry

Ошибка, вызванная

 Caused by: java.lang.NoSuchMethodError:
 org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;
    at
 springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)
    at
 springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.defaultContextBuilder(DocumentationPluginsBootstrapper.java:106)
    at
 springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.buildContext(DocumentationPluginsBootstrapper.java:91)
    at
 springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:154)
    at
 org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
    ... 101 common frames omitted

build.gradle

dependencies {

    compile "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client"
    compile "io.opentracing.contrib:opentracing-spring-jaeger-cloud-starter:1.0.1"
    compile "org.springframework.boot:spring-boot-starter"
    compile "org.springframework.boot:spring-boot-starter-amqp"
    compile "org.springframework.boot:spring-boot-starter-web"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.springframework.boot:spring-boot-starter-security"
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-starter-data-rest"
    compile "org.springframework.boot:spring-boot-starter-data-mongodb"
    compile "org.springframework.boot:spring-boot-starter-aop"
    compile "org.springframework:springloaded:1.2.8.RELEASE"
    compile "org.springframework.security:spring-security-web"
    compile "org.springframework.security:spring-security-config"
    compile "org.apache.commons:commons-collections4:4.1"
    compile "com.fasterxml.jackson.core:jackson-databind:2.9.10"
    compile "com.google.guava:guava:${guava_version}"
    compile(group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0') {
        exclude(module: 'guava')
    }
    compile "javax.cache:cache-api:1.1.0"
    compile "org.springframework.boot:spring-boot-starter-websocket"
    compile "org.springframework.boot:spring-boot-configuration-processor"
    compile "org.springframework.boot:spring-boot-starter-cache"
    compile "com.hazelcast:hazelcast-spring:3.12"
    compile "com.hazelcast:hazelcast-eureka-one:1.0.2"
    compile "org.reflections:reflections:0.9.11"
    compile group: 'io.opentracing.contrib', name: 'opentracing-spring-cloud-mongo-starter', version: '0.3.12'


}    

Как решить эту проблему? Пожалуйста, помогите мне, я был бы благодарен. Я хочу обновить приложение до springboot v2.2.2. Мне нужно решение для этой версии.

1 Ответ

4 голосов
/ 08 января 2020

Обновите версию springfox-swagger. У меня Springfox 2.9.2 работает с загрузкой 2.2.2

Редактировать 98.01.2020:

Вы как-то получили spring-plugin-core-2.2.0.RELEASE в ваш классный путь. SpringFox требуется версия 1.2.0, сама Spring Boot 2.2.2 этого не использует. Можете ли вы запустить зависимости gradle --configuration runtimeClasspath и проверить, какая зависимость извлекается в этой версии?

...