com.netflix.hystrix.exception.HystrixRuntimeException: MallFeign#getGoodsOrderData(String) failed and no fallback available.
Caused by: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `java.util.Date` from String "2020-10-22 11:35:10": not a valid representation (error: Failed to parse Date value '2020-10-22 11:35:10': Cannot parse date "2020-10-22 11:35:10": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null)); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.util.Date` from String "2020-10-22 11:35:10": not a valid representation (error: Failed to parse Date value '2020-10-22 11:35:10': Cannot parse date "2020-10-22 11:35:10": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null))
at [Source: (ByteArrayInputStream); line: 1, column: 1601] (through reference chain: com.common.api.ApiResult["data"]->java.util.ArrayList[1]->com.szgpushservice.common.dto.GoodsOrderDTO["closedTime"])
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:245)
远程调用获取时间的时候,报了参数解析出错。
原来报错的代码:
@ApiModelProperty(value = "关闭时间")
private Date closedTime;
加注解之后:
@ApiModelProperty(value = "关闭时间")
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
private Date closedTime;
已解决!!!