eureka客户端注册服务失败,后缀上下文错误

2024-06-12 19:09:00.652 WARN 1224 --- [ main] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: Error while extracting response for type [class org.springframework.cloud.netflix.eureka.http.EurekaApplications] and content type [application/json]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Root name ('timestamp') does not match expected ('applications') for type `org.springframework.cloud.netflix.eureka.http.EurekaApplications`; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Root name ('timestamp') does not match expected ('applications') for type `org.springframework.cloud.netflix.eureka.http.EurekaApplications`
at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 2] (through reference chain: org.springframework.cloud.netflix.eureka.http.EurekaApplications["timestamp"])
2024-06-12 19:09:00.654 INFO 1224 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_EURAKACLIENT-USERSERVICE/UPC-PC:eurakaClient-userService:8401 - was unable to refresh its cache! This periodic background refresh will be retried in 30 seconds. status = Cannot execute request on any known server stacktrace = com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

原因:

调用心跳函数向注册中心发送信息时解析失败

解決方案:

euraka要求服务端和客户端的后缀要为eureka保持一致

我的服务端配置

我的客户端配置

 

 修改为:

服务端

 客户端

 

启动成功。

 

 

posted on 2024-06-12 19:22  丶柚子  阅读(13)  评论(0编辑  收藏  举报

导航