问题
I am upgraded SpringBoot version 2.1.0 to 2.2.2.RELEASE
java : openjdk11 spring-boot: v2.2.0.RELEASE springCloudVersion : Hoxton.RC1
Error :
APPLICATION FAILED TO START
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)
The following method did not exist:
org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang> /Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;
The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
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
It was loaded from the following location:
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
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
Error caused by
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'
}
How to solve this issue? Please help me it would be grateful. I want to upgrade my application to springboot v2.2.2 .So need a solution for this version.
回答1:
Update your springfox-swagger version. I have springfox 2.9.2 running with boot 2.2.2
Edit 98.01.2020:
You somehow got spring-plugin-core-2.2.0.RELEASE in your classpath. SpringFox needs version 1.2.0, Spring Boot 2.2.2 itself does not pull this in. Can you run gradle dependencies --configuration runtimeClasspath and check which dependency pulls in this version?
来源:https://stackoverflow.com/questions/59647727/upgraded-spring-boot-from-2-1-0-to-2-2-2-release-now-getting-exception-while-s