SpringCloudError creating bean with name ‘configurationPropertiesBeans‘

Posted 幽灵雾

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringCloudError creating bean with name ‘configurationPropertiesBeans‘相关的知识,希望对你有一定的参考价值。

【问题现象】

IDEA中搭建SpringCloud体系,运行时提示红色错误:


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

【原因】

这是SpringCloud体系非常常见的问题,原因是Spring boot版本和Spring cloud版本不兼容,导致问题。

【解决】

Spring boot版本和Spring cloud版本,需要严格按照官方提供的版本来进行匹配,官网链接:
https://spring.io/projects/spring-cloud

不同cloud需要对应不同的boot版本,如图:

换版本例子:

版本替换后,reload所有maven项目即可,如图:

若仍报错,则重新执行mvn clean package

以上是关于SpringCloudError creating bean with name ‘configurationPropertiesBeans‘的主要内容,如果未能解决你的问题,请参考以下文章

Delphi Create(nil), Create(self), Create(Application)的区别

delphi7中create(nil)与create(self)区别

epoll_create和epoll_create1

epoll_create和epoll_create1

epoll_create和epoll_create1

link_to :action => 'create' 去索引而不是 'create'