出现 Cannot deserialize value of type `java.time.LocalDateTime` from String 解决方法

2024-07-11 1099阅读

目录

  • 1. 问题所示
  • 2. 原理分析
  • 3. 解决方法
    • 3.1 修改Json数据格式
    • 3.2 @JsonFormat注解
    • 3.3 更换格式
    • 3.4 序列化和反序列化

1. 问题所示

执行功能模块的时候,后端(浏览器)弹出如下提示

出现 Cannot deserialize value of type `java.time.LocalDateTime` from String 解决方法
(图片来源网络,侵删)
JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String \"2024-06-06\": Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '2024-06-06' could not be parsed at index 10; 
nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type 
VPS购买请点击我

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

目录[+]