When the SpringCloud system is built in IDEA, a red error is displayed when running:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'configurationPropertiesBeans' defined in class path resource
[org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]:
Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException:
Failed to introspect Class
[org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]
from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
......
Caused by: java.lang.IllegalStateException:
Failed to introspect Class
[org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]
from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
......
Caused by: java.lang.NoClassDefFoundError:
org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
......
Caused by: java.lang.ClassNotFoundException:
org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata
This is a very common problem in the Spring Cloud system. The reason is the incompatibility between the Spring boot version and the Spring cloud version, causing problems.
The Spring boot version and Spring cloud version need to be matched strictly in accordance with the official version. The official website link:
https://spring.io/projects/spring-cloud
Different clouds need to correspond to different boot versions, as shown in the figure:
Change version example:
After the version is replaced, reload all maven projects.
If the error is still reported, re-execute mvn clean package