[problem phenomenon]
When the springcloud system is built in the idea, a red error is prompted at runtime:
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
[reason]
This is a very common problem in the spring cloud system because the spring boot version is incompatible with the spring cloud version.
[solution]
The spring boot version and spring cloud version should be matched in strict accordance with the official version. Link to the official website:
https://spring.io/projects/spring-cloud
Different clouds need different boot versions, as shown in the figure:
Example of version change:
after version replacement, reload all Maven items, as shown in the figure:
If an error is still reported, re-execute the MVN clean package