关于spring-cloud 的提供者服务启动报错解决办法。

本文详细解析了Spring Boot应用在启动过程中遇到的错误,具体表现为CommonAnnotationBeanPostProcessor调用销毁方法失败。错误根源在于pom文件缺失spring-boot-starter-web依赖。文中提供了正确的依赖配置代码,帮助读者快速解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在刚启动过程中,大概启动1秒左右就出现如下错误。 

s.c.a.CommonAnnotationBeanPostProcessor : Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaInstanceConfigBean': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)

以上错误是由于pom文件缺少spring-boot-starter-web依赖jar。

    <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>

增加以上jar 完美解决。

解决错误问题。一定先要看清楚问题,现在百度中有很多人,看见一堆报错就各种尝试。这种解决方法是很不可取的。首先看清楚问题错误是否一样。再尝试方法。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值