org.springframework.http.converter.HttpMessageNotReadableException

org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `java.util.Date` from String "2019-12-16 06:11:08": not a valid representation (error: Failed to parse Date value '2019-12-16 06:11:08': Cannot parse date "2019-12-16 06:11:08": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null));

对于出现这样的错误,说明是字符串转换成日期对象出错,实体类中的日期字段设置指定日期格式化的格式

检查传递的参数的字符串日期格式是否是上面设置的格式

posted @ 2019-12-23 21:09  ALonely  阅读(6140)  评论(0编辑  收藏  举报