异常描述:
org.springframework.web.client.RestClientException: Error while extracting response for type [com.mydao.tourist.base.BaseResult<java.util.List<com.mydao.tourist.fegin.dto.ESGroupSqlRespVo>>] and content type [application/json]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: Invalid JSON input: Cannot deserialize instance of `java.util.ArrayList<com.mydao.tourist.fegin.dto.ESGroupSqlRespVo>` out of VALUE_STRING token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList<com.mydao.tourist.fegin.dto.ESGroupSqlRespVo>` out of VALUE_STRING token
at [Source: (PushbackInputStream); line: 1, column: 73] (through reference chain: com.mydao.tourist.base.BaseResult["data"])
控制台 异常:
DynamicServerListLoadBalancer for client ticketing-elastic-statistics-main initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=ticketing-elastic-statistics-main,current list of Servers=[192.168.1.236:7611],Load balancer stats=Zone stats: {defaultzone=[Zone:defaultzone; Instance count:1; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;]
},Server stats: [[Server:192.168.1.236:7611; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 08:00:00 CST 1970; First connection made: Thu Jan 01 08:00:00 CST 1970; Active Connections:0; total failure count in last (1000) msecs:0; average resp time:0.0; 90 percentile resp time:0.0; 95 percentile resp time:0.0; min resp time:0.0; max resp time:0.0; stddev resp time:0.0]
]}ServerList:org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList@2383f259
2023-07-11 16:00:34 |INFO | com.netflix.config.ChainedDynamicProperty [115] | Flipping property: ticketing-elastic-statistics-main.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
Feign
xxxxx: 代指接口服务名 跟此异常无关
APIUrl:代指接口地址 跟此异常无关
加上 红色字体的 部分即可解决 ;
consumes = "application/json; charset=UTF-8", produces = "application/json; charset=UTF-8"
/**
* @Author wzq
* @Version 1.0
* @Description //TODO ES统计中心 API
* @Date 2023/6/26
**/
@FeignClient(name = "xxxxx", configuration = FeignTokenInterceptor.class)
public interface EsStatisticsService {
/**
* ES统计的【FeignAPI】
* todo 统计数据API
* */
@PostMapping(value = "APIUrl", consumes = "application/json; charset=UTF-8", produces = "application/json; charset=UTF-8")
@ApiOperation(value = "统计数据API", notes = "统计数据API", httpMethod = "POST")
BaseResult<List<ESGroupSqlRespVo>> categoryStatisticsDataAPI(@RequestBody CategoryStatisticsDataReqVo categoryStatisticsDataReqVo);
}