在写spring cloud 代码时,启动spring boot时出现了这个异常。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapimportSelectorConfiguration': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationPropertiesBean
...
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationPropertiesBean
原因是spring boot依赖包和spring cloud依赖包的版本不兼容。
后来我spring boot的依赖包改成如下的
org.springframework.boot spring-boot-starter-parent2.2.8.RELEASE
spring cloud依赖包改成如下的。
org.springframework.cloud spring-cloud-dependenciesHoxton.SR8 pom import
这样两者版本兼容了,问题就解决了。



