JSON parse error: Cannot deserialize value of type `java.util.Date` from String

org.springframework.web.client.RestClientException: Error while extracting response for type [cn.swifthealth.core.result.JsonResult>] and content type [application/json;charset=UTF-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type java.util.Date from String “+0000-12-31T16:00:00.000+0000”: not a valid representation (error: Failed to parse Date value ‘+0000-12-31T16:00:00.000+0000’: Cannot parse date “+0000-12-31T16:00:00.000+0000”: not compatible with any of standard forms (“yyyy-MM-dd’T’HH:mm:ss.SSSZ”, “yyyy-MM-dd’T’HH:mm:ss.SSS”, “EEE, dd MMM yyyy HH:mm:ss zzz”, “yyyy-MM-dd”)); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type java.util.Date from String “+0000-12-31T16:00:00.000+0000”: not a valid representation (error: Failed to parse Date value ‘+0000-12-31T16:00:00.000+0000’: Cannot parse date “+0000-12-31T16:00:00.000+0000”: not compatible with any of standard forms (“yyyy-MM-dd’T’HH:mm:ss.SSSZ”, “yyyy-MM-dd’T’HH:mm:ss.SSS”, “EEE, dd MMM yyyy HH:mm:ss zzz”, “yyyy-MM-dd”))

2020-01-13 17:32:05.390 INFO cn.swifthealth.sync.api.common.RestSyncService - 开始请求同步系统http://1.85.45.235:37066/sync2cloud/v1/sync2cloud/cli_diag,请求body为{“hisId”:100,“page”:0,“size”:100,“syncEndDate”:“2020-01-13 17:00:34”,“syncStartDate”:“2020-01-12 16:58:04”},请求方式为POST
org.springframework.web.client.RestClientException: Error while extracting response for type [cn.swifthealth.core.result.JsonResult>] and content type [application/json;charset=UTF-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type java.util.Date from String “+0000-12-31T16:00:00.000+0000”: not a valid representation (error: Failed to parse Date value ‘+0000-12-31T16:00:00.000+0000’: Cannot parse date “+0000-12-31T16:00:00.000+0000”: not compatible with any of standard forms (“yyyy-MM-dd’T’HH:mm:ss.SSSZ”, “yyyy-MM-dd’T’HH:mm:ss.SSS”, “EEE, dd MMM yyyy HH:mm:ss zzz”, “yyyy-MM-dd”)); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type java.util.Date from String “+0000-12-31T16:00:00.000+0000”: not a valid representation (error: Failed to parse Date value ‘+0000-12-31T16:00:00.000+0000’: Cannot parse date “+0000-12-31T16:00:00.000+0000”: not compatible with any of standard forms (“yyyy-MM-dd’T’HH:mm:ss.SSSZ”, “yyyy-MM-dd’T’HH:mm:ss.SSS”, “EEE, dd MMM yyyy HH:mm:ss zzz”, “yyyy-MM-dd”))
at [Source: (PushbackInputStream); line: 1, column: 35582] (through reference chain: cn.swifthealth.core.result.JsonResult[“data”]->java.util.ArrayList[57]->cn.swifthealth.entity.his.CliDiag[“hisOperTime”])

修改方法:
/**
* his操作时间
*/
@JsonFormat(pattern = “yyyy-MM-dd HH:mm:ss”, timezone = “GMT+8”)
@DateTimeFormat(pattern = “yyyy-MM-dd HH:mm:ss”)
private Date hisOperTime;

参考链接:https://blog.csdn.net/zhangminemail/article/details/83188522

你可能感兴趣的:(JSON parse error: Cannot deserialize value of type `java.util.Date` from String)