Failed to start bean ‘webServerStartStop‘; nested exception is java.lang.reflect.UndeclaredThrowable

使用nacos出现报错

org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is java.lang.reflect.UndeclaredThrowableException
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
	at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:62)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
	at com.atguigu.srb.gateway.ServiceGatewayApplication.main(ServiceGatewayApplication.java:13)
Caused by: java.lang.reflect.UndeclaredThrowableException
	at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:147)
	at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:79)
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:239)
	at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:76)
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:138)
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:101)
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:88)
	at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
	at org.springframework.boot.web.reactive.context.WebServerManager.start(WebServerManager.java:56)
	at org.springframework.boot.web.reactive.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:40)
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
	... 14 more
Caused by: ErrCode:500, ErrMsg:failed to req API:/nacos/v1/ns/instance after all servers([localhost:8848]) tried: ErrCode:503, ErrMsg:server is DOWN now, please try again later!
	at com.alibaba.nacos.client.naming.net.NamingProxy.reqApi(NamingProxy.java:552)
	at com.alibaba.nacos.client.naming.net.NamingProxy.reqApi(NamingProxy.java:491)
	at com.alibaba.nacos.client.naming.net.NamingProxy.reqApi(NamingProxy.java:486)
	at com.alibaba.nacos.client.naming.net.NamingProxy.registerService(NamingProxy.java:239)
	at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:200)
	at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:70)
	... 28 more

解决方法
删除nacos目录下的data重新启动
在这里插入图片描述

  • 7
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
这个错误是由于启动bean 'webServerStartStop'时出现了问题,导致抛出了一个异常java.lang.reflect.UndeclaredThrowableException。根据引用\[1\]中提供的信息,可能有三个地方出错。首先,nacos配置文件的ip地址可能有问题。其次,nginx的upstream nacos-cluster的地址可能有问题。最后,java的yml文件中的server-addr地址可能有问题。你可以检查这三个地方的配置是否正确。另外,引用\[2\]中的错误信息也提到了nacos服务器出现了问题,可能是服务器宕机或者其他原因导致无法连接。最后,引用\[3\]中的错误信息是关于com.mchange.v2.cfg.BasicMultiPropertiesConfig类的一个方法找不到的错误。这可能是由于版本不匹配或者依赖关系有问题导致的。你可以检查一下相关的依赖和版本是否正确。希望这些信息对你有帮助。 #### 引用[.reference_title] - *1* *2* [[完美解决] Failed to start bean ... nested exception is java.lang.reflect.UndeclaredTh](https://blog.csdn.net/web15870359587/article/details/125346205)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError](https://blog.csdn.net/A_dg_Jffery/article/details/97108015)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值