笔者在实现SpringCloud整合Eureka注册中心时出现如下报错:
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
项目目录结构为:
原因:
SpringCloud和SpringBoot的版本不兼容
SpringCloud与SpringBoot版本对应关系:
解决方案:
更改SpringCloud以及SpringBoot的版本:
项目总pom文件中
SpringCloud版本为:Hoxton.SR9
SpringBoot版本为:2.2.5.RELEASE
SpringCloud-Eureka-7001中pom文件:
spring-cloud-starter-netflix-eureka-server的版本为:2.2.5.RELEASE
版本对应好后,即可启动服务: