Today I upgraded my Spring Cloud to version 2020.0.3 and Spring Boot version to 2.4.9. When I run the app shows error like this:
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata
at java.net.URLClassLoader.findClass(URLClassLoader.java:605) ~[?:?]
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:1183) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:1098) ~[?:?]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) ~[dolphin-gateway-1.0.0-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:1081) ~[?:?]
at java.lang.Class.getDeclaredMethodsImpl(Native Method) ~[?:?]
at java.lang.Class.getDeclaredMethods(Class.java:1146) ~[?:?]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463) ~[spring-core-5.3.9.jar!/:5.3.9]
at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321) ~[spring-core-5.3.9.jar!/:5.3.9]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.buildLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:232) ~[spring-beans-5.3.9.jar!/:5.3.9]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:210) ~[spring-beans-5.3.9.jar!/:5.3.9]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(InitDestroyAnnotationBeanPostProcessor.java:149) ~[spring-beans-5.3.9.jar!/:5.3.9]
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(CommonAnnotationBeanPostProcessor.java:294) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:1098) ~[spring-beans-5.3.9.jar!/:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) ~[spring-beans-5.3.9.jar!/:5.3.9]
... 41 more
I've searched the internet and this told me this problem is caused by a version incompatibility. The version is compatible right now, I read the official document, why does it still show this error? What should I do to fix it? I found the org.springframework.boot:spring-boot-starter-data-redis
using org.springframework:spring-beans:5.3.9
, is there possible to fix?
$ ./script/dependencies.sh ‹ruby-2.7.2›
+ ./gradlew :dolphin-gateway:dependencies --configuration runtimeClasspath
+ grep -v '(*)'
+ grep -C 10 spring-beans
| | +--- org.apache.commons:commons-collections4:4.4
| | +--- org.apache.commons:commons-lang3:3.9
| | +--- org.springframework.boot:spring-boot-starter-parent:2.4.9
| | +--- org.springframework.boot:spring-boot-starter-data-redis -> 2.4.9
| | | \--- org.springframework.boot:spring-boot-starter:2.4.9
| | | +--- org.springframework.boot:spring-boot:2.4.9
| | | | +--- org.springframework:spring-core:5.3.9
| | | | | \--- org.springframework:spring-jcl:5.3.9
| | | | \--- org.springframework:spring-context:5.3.9
| | | | +--- org.springframework:spring-aop:5.3.9
| | | | | +--- org.springframework:spring-beans:5.3.9
| | | | \--- org.springframework:spring-expression:5.3.9
| | | +--- org.springframework.boot:spring-boot-autoconfigure:2.4.9
| | | +--- org.springframework.boot:spring-boot-starter-logging:2.4.9
| | | | \--- org.slf4j:jul-to-slf4j:1.7.32
| | | | \--- org.slf4j:slf4j-api:1.7.32
| | | +--- jakarta.annotation:jakarta.annotation-api:1.3.5
| | | \--- org.yaml:snakeyaml:1.27
| | +--- org.springframework.data:spring-data-redis:2.5.0
| | | +--- org.springframework.data:spring-data-keyvalue:2.5.0 -> 2.4.11
| | | | +--- org.springframework.data:spring-data-commons:2.4.11
(base)