java如何反序列化响应处理程序REST模板的数据时间?
我正在使用ResponseErrorHandler接口来处理服务器错误和客户端错误
我从外部API得到这个响应 { “时间戳”:“2021-08-02T12:04:45.332+0000”, “状态”:400, “错误”:“错误请求”, “消息”:“空值异常”, }
现在我有了反序列化的类
public class ApplicationPayload {
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
private LocalDateTime timestamp;
private HttpStatus status;
private String error;
private String message;
//getter and setter
}
@Override
public void handleError(ClientHttpResponse response) throws IOException {}
我在handleError方法中遇到此错误
未能反序列化java。时间LocalDateTime:(java.time.format.DateTimeParseException)无法分析文本“2021-08-02T12:04:45.332+0000”,在索引23处找到未分析的文本
共 (0) 个答案