JSON parse error: Cannot deserialize value of type `java.util.Date` from String \"2022-10-24 09:57:07\": expected format \"yyyy-MM-dd HH:mm:ss\"; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.util.Date` from String \"2022-10-24 09:57:07\": expected format \"yyyy-MM-dd HH:mm:ss\"\n at [Source: (PushbackInputStream); line: 1, column: 58] (through reference chain: org.springblade.wisdom_elevator.encity.Monitoring[\"createTime\"])"
此报错,尝试了好多注解之类的,但是没有用,根本原因是我当时比较懒将获取到的json对象数据放到了微信中,虽然没有发送出去,但这段json在格式上已经变了好多。好像连时间格式也发生了变化,就连里面的空格都出现了异常。
空格异常报了这个错:
"msg": "JSON parse error: Unexpected character (' ' (code 160)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character (' ' (code 160)): was expecting double-quote to start field name\n at [Source: (PushbackInputStream); line: 1, column: 4]"
结论是:数据一定不要放到微信中。格式有可能发生变化。即使你没有发送出去。要放就放在记事本中。