springcloud和springboot版本不一致启动报错解决

springcloud和springboot版本不一致启动报错解决

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2021-10-18 16:37:35.490 ERROR 16680 — [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans’ defined in class path resource [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]: Factory method ‘configurationPropertiesBeans’ threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean 0 ( A b s t r a c t B e a n F a c t o r y . j a v a : 335 )   [ s p r i n g − b e a n s − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 234 )   [ s p r i n g − b e a n s − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 333 )   [ s p r i n g − b e a n s − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 213 )   [ s p r i n g − b e a n s − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . r e g i s t e r B e a n P o s t P r o c e s s o r s ( P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . j a v a : 270 )   [ s p r i n g − c o n t e x t − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e g i s t e r B e a n P o s t P r o c e s s o r s ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 762 )   [ s p r i n g − c o n t e x t − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 567 )   [ s p r i n g − c o n t e x t − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h ( S p r i n g A p p l i c a t i o n . j a v a : 754 )   [ s p r i n g − b o o t − 2.5.5. j a r : 2.5.5 ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h C o n t e x t ( S p r i n g A p p l i c a t i o n . j a v a : 434 )   [ s p r i n g − b o o t − 2.5.5. j a r : 2.5.5 ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 338 )   [ s p r i n g − b o o t − 2.5.5. j a r : 2.5.5 ] a t o r g . s p r i n g f r a m e w o r k . b o o t . b u i l d e r . S p r i n g A p p l i c a t i o n B u i l d e r . r u n ( S p r i n g A p p l i c a t i o n B u i l d e r . j a v a : 143 ) [ s p r i n g − b o o t − 2.5.5. j a r : 2.5.5 ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . b o o t s t r a p . B o o t s t r a p A p p l i c a t i o n L i s t e n e r . b o o t s t r a p S e r v i c e C o n t e x t ( B o o t s t r a p A p p l i c a t i o n L i s t e n e r . j a v a : 203 ) [ s p r i n g − c l o u d − c o n t e x t − 2.1.2. R E L E A S E . j a r : 2.1.2. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . b o o t s t r a p . B o o t s t r a p A p p l i c a t i o n L i s t e n e r . o n A p p l i c a t i o n E v e n t ( B o o t s t r a p A p p l i c a t i o n L i s t e n e r . j a v a : 114 ) [ s p r i n g − c l o u d − c o n t e x t − 2.1.2. R E L E A S E . j a r : 2.1.2. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c l o u d . b o o t s t r a p . B o o t s t r a p A p p l i c a t i o n L i s t e n e r . o n A p p l i c a t i o n E v e n t ( B o o t s t r a p A p p l i c a t i o n L i s t e n e r . j a v a : 71 ) [ s p r i n g − c l o u d − c o n t e x t − 2.1.2. R E L E A S E . j a r : 2.1.2. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . e v e n t . S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . d o I n v o k e L i s t e n e r ( S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . j a v a : 176 ) [ s p r i n g − c o n t e x t − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . e v e n t . S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . i n v o k e L i s t e n e r ( S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . j a v a : 169 ) [ s p r i n g − c o n t e x t − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . e v e n t . S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . m u l t i c a s t E v e n t ( S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . j a v a : 143 ) [ s p r i n g − c o n t e x t − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . e v e n t . S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . m u l t i c a s t E v e n t ( S i m p l e A p p l i c a t i o n E v e n t M u l t i c a s t e r . j a v a : 131 ) [ s p r i n g − c o n t e x t − 5.3.10. j a r : 5.3.10 ] a t o r g . s p r i n g f r a m e w o r k . b o o t . c o n t e x t . e v e n t . E v e n t P u b l i s h i n g R u n L i s t e n e r . e n v i r o n m e n t P r e p a r e d ( E v e n t P u b l i s h i n g R u n L i s t e n e r . j a v a : 82 ) [ s p r i n g − b o o t − 2.5.5. j a r : 2.5.5 ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n R u n L i s t e n e r s . l a m b d a 0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.10.jar:5.3.10] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.10.jar:5.3.10] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.10.jar:5.3.10] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) ~[spring-beans-5.3.10.jar:5.3.10] at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:270) ~[spring-context-5.3.10.jar:5.3.10] at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:762) ~[spring-context-5.3.10.jar:5.3.10] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:567) ~[spring-context-5.3.10.jar:5.3.10] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.5.jar:2.5.5] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.5.jar:2.5.5] at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.5.jar:2.5.5] at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) [spring-boot-2.5.5.jar:2.5.5] at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:203) [spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE] at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114) [spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE] at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:71) [spring-cloud-context-2.1.2.RELEASE.jar:2.1.2.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) [spring-context-5.3.10.jar:5.3.10] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) [spring-context-5.3.10.jar:5.3.10] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) [spring-context-5.3.10.jar:5.3.10] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) [spring-context-5.3.10.jar:5.3.10] at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82) [spring-boot-2.5.5.jar:2.5.5] at org.springframework.boot.SpringApplicationRunListeners.lambda 0(AbstractBeanFactory.java:335) [springbeans5.3.10.jar:5.3.10]atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [springbeans5.3.10.jar:5.3.10]atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) [springbeans5.3.10.jar:5.3.10]atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) [springbeans5.3.10.jar:5.3.10]atorg.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:270) [springcontext5.3.10.jar:5.3.10]atorg.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:762) [springcontext5.3.10.jar:5.3.10]atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:567) [springcontext5.3.10.jar:5.3.10]atorg.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) [springboot2.5.5.jar:2.5.5]atorg.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) [springboot2.5.5.jar:2.5.5]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:338) [springboot2.5.5.jar:2.5.5]atorg.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143)[springboot2.5.5.jar:2.5.5]atorg.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:203)[springcloudcontext2.1.2.RELEASE.jar:2.1.2.RELEASE]atorg.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114)[springcloudcontext2.1.2.RELEASE.jar:2.1.2.RELEASE]atorg.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:71)[springcloudcontext2.1.2.RELEASE.jar:2.1.2.RELEASE]atorg.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)[springcontext5.3.10.jar:5.3.10]atorg.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)[springcontext5.3.10.jar:5.3.10]atorg.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)[springcontext5.3.10.jar:5.3.10]atorg.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)[springcontext5.3.10.jar:5.3.10]atorg.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)[springboot2.5.5.jar:2.5.5]atorg.springframework.boot.SpringApplicationRunListeners.lambdaenvironmentPrepared$2(SpringApplicationRunListeners.java:63) [spring-boot-2.5.5.jar:2.5.5]
at java.util.ArrayList.forEach(ArrayList.java:1259) ~[na:1.8.0_301]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) [spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) [spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62) [spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:332) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.5.jar:2.5.5]
at com.example.springsecurityoath2demo.Springsecurityoath2DemoApplication.main(Springsecurityoath2DemoApplication.java:10) ~[classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]: Factory method ‘configurationPropertiesBeans’ threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.10.jar:5.3.10]
… 34 common frames omitted

出现这种错误一般是版本不对应导致的
错误版本号对应

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.5.5</version>
        <relativePath/>
    </parent>
    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
    </properties>

正确版本号对应

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.10.RELEASE</version>
        <relativePath/>
    </parent>
 <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
    </properties>

对应springcloud和Springboot的版本号就可以了,不然很容易出现不明的错误,最后附上springcloud 和Springboot版本地址

Spring Cloud Dependencies的版本地址

Spring Boot Starter Parent的版本地址

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值