SpringCloud客戶端報錯:- was unable to send heartbeat!的解決
微服務(wù)啟動時報錯
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客戶端無法發(fā)送心跳到服務(wù)端
解決方案
查看客戶端啟動類是否添加服務(wù)注冊、發(fā)現(xiàn)注解。
@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>
重啟解決問題。
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Java實現(xiàn)在線考試系統(tǒng)與設(shè)計(學(xué)生功能)
這篇文章主要介紹了Java實現(xiàn)在線考試系統(tǒng)與設(shè)計(學(xué)生功能),本文通過實例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下2020-02-02
Java使用freemarker實現(xiàn)word下載方式
文章介紹了如何使用FreeMarker實現(xiàn)Word文件下載,包括引用依賴、創(chuàng)建Word模板、將Word文件存為XML格式、更改后綴為FTL模板、處理圖片和代碼實現(xiàn)2025-02-02
SpringBoot+BootStrap多文件上傳到本地實例
這篇文章主要介紹了SpringBoot+BootStrap多文件上傳到本地實例,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-03-03
springboot啟動后卡住無日志的幾種情況小結(jié)
這篇文章主要介紹了springboot啟動后卡住無日志的幾種情況小結(jié),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-12-12

