SpringCloud客户端报错:-wasunabletosendheartbeat!的解决
微服务启动时报错
2021-05-18 21:25:44.644 WARN 5452 — [tbeatExecutor-0] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: null
2021-05-18 21:25:44.644 ERROR 5452 — [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SERVICE-HI/LAPTOP-3BVBK0KA:service-hi:8763 - was unable to send heartbeat!
问题原因
Eureka客户端无法发送心跳到服务端
解决方案
查看客户端启动类是否添加服务注册、发现注解。
@EnableEurekaClient
@EnableDiscoveryClient
SpringCloud客户端启动报错
·Destroy method on bean with name ‘scopedTarget.eurekaClient’ threw an exception: 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!)
Registering application UNKNOWN with eureka with status UP
DiscoveryClient_UNKNOWN/DESKTOP-MQ8D0C9:8761 > - was unable to refresh its cache! status = Cannot execute request on any known server
项目启动后自动停止,在控制台没看到启动的端口,估计是没有引入spring boot的web包
在pom文件中引入如下
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId
</dependency>
重启解决问题。
以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341