apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.08k stars 8.73k forks source link

JsonParser 错误 用的最新版本还是报错有什么好的解决方案吗 #6620

Closed basketballboy closed 2 weeks ago

basketballboy commented 2 weeks ago

依赖版本:

io.seata seata-spring-boot-starter 2.0.0

deserialize java.time.LocalDateTime error : Current token (FIELD_NAME) not numeric, can not use numeric value accessors at [Source: (byte[])"{"@class":"io.seata.rm.datasource.undo.BranchUndoLog","xid":"10.115.53.2:8091:1405657052835082267","branchId":1405657052835082268,"sqlUndoLogs":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.undo.SQLUndoLog","sqlType":"INSERT","tableName":"t_test","beforeImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords$EmptyTableRecords","tableName":"t_test","rows":["java.util.ArrayList",[]]},"afterImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords","tableName":"t_test","[truncated 1680 bytes]; line: 1, column: 1119] com.fasterxml.jackson.core.JsonParseException: Current token (FIELD_NAME) not numeric, can not use numeric value accessors at [Source: (byte[])"{"@class":"io.seata.rm.datasource.undo.BranchUndoLog","xid":"10.115.53.2:8091:1405657052835082267","branchId":1405657052835082268,"sqlUndoLogs":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.undo.SQLUndoLog","sqlType":"INSERT","tableName":"t_test","beforeImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords$EmptyTableRecords","tableName":"t_test","rows":["java.util.ArrayList",[]]},"afterImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords","tableName":"t_test","[truncated 1680 bytes]; line: 1, column: 1119] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1851)

funky-eyes commented 2 weeks ago

Was this undolog built by version 2.0?

basketballboy commented 2 weeks ago

yes

funky-eyes commented 2 weeks ago

Are you sure it wasn't built by a lower version and failed to rollback after upgrading to a higher version?

basketballboy commented 2 weeks ago

image

funky-eyes commented 2 weeks ago

image

我的意思是说,你是不是之前用了低版本构建了这个undolog,发现回滚失败,然后升级了高版本。实际上这个undolog是低版本的时候创建出来的,没有走jackson的localdatetime JsonSerializer

funky-eyes commented 2 weeks ago

https://github.com/apache/incubator-seata/blob/2.x/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/parser/JacksonUndoLogParser.java

LocalDateTimeSerializer LocalDateTimeDeserializer