Cannot deserialize value of type `java.util.Date` from String

后端 未结 1 1080
傲寒
傲寒 2021-01-17 07:45

Using Spring 1.5.8.RELEASE Jackson mapper giving the following exception.

Cannot deserialize value of type `java.util.Date` from String \"2018-09-04T10:44:46         


        
相关标签:
1条回答
  • 2021-01-17 08:08

    Change your @JsonFormat line to this.

    @JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ss")
    

    The format pattern you have right now expects the sting to have millisecond values - but your example string doesn't have them.

    0 讨论(0)
提交回复
热议问题