异常现象:
有一个对象,它有Date类型的属性、也有LocalDateTime类型的属性(或其它Java8 Time类)。使用ObjectMapper将这个对象转为了json串,然后用writeValueAsString()将这个串解析回对象时,Date类型的属性没问题,而LocalDateTime类型的属性报错:Cannot construct instance of java.time.LocalDateTime
(no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)......
原因和解决方法: