Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/Configuration
在写spring cloud 代码时,启动spring boot时出现了这个异常。org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapImportSelectorConfiguration': Initialization of bean failed; n
在写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的依赖包改成如下的
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.8.RELEASE</version> <relativePath/> </parent>
spring cloud依赖包改成如下的。
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Hoxton.SR8</version> <type>pom</type> <scope>import</scope> </dependency>
这样两者版本兼容了,问题就解决了。
这是我的公众号,其中包含了大量面试文章,同时我自己出了多本Python和Java方面的书籍,会定期在公众号里发书的电子版。请大家关注下我的公众号,谢谢了。
更多推荐
所有评论(0)