You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.NoSuchMethodException: java.sql.Timestamp.valueOf [class java.time.LocalDateTime]
at java.lang.Class.getMethod(Class.java:2072)
at java.lang.Class.getMethod(Class.java:1693)
at com.alibaba.fastjson2.util.JdbcSupport$TimestampReader.<init>(JdbcSupport.java:494)
at com.alibaba.fastjson2.util.JdbcSupport.createTimestampReader(JdbcSupport.java:41)
at com.alibaba.fastjson2.reader.ObjectReaderBaseModule.getObjectReader(ObjectReaderBaseModule.java:2083)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReader(ObjectReaderProvider.java:902)
at com.alibaba.fastjson2.JSONReader$Context.getObjectReader(JSONReader.java:3508)
at com.alibaba.fastjson2.reader.FieldReaderObject.readFieldValue(FieldReaderObject.java:106)
at com.alibaba.fastjson2.reader.ObjectReader6.readObject(ObjectReader6.java:378)
at com.alibaba.fastjson2.reader.FieldReaderObject.readFieldValue(FieldReaderObject.java:295)
at com.alibaba.fastjson2.reader.ObjectReaderNoneDefaultConstructor.readObject(ObjectReaderNoneDefaultConstructor.java:291)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:786)
问题描述
Android端直接使用的java服务端提供的VO层Jar包依赖,其中出参参数birthday使用java.sql.Timestamp类型;
Android端反序列化birthday参数时报错:
java.lang.NoSuchMethodException: java.sql.Timestamp.valueOf [class java.time.LocalDateTime]
环境信息
重现步骤
我的独立测试代码如下:
可以定义一个包含java.sql.Timestamp的对象,进行反序列化测试;
同时反序列化JSON的时间值为 "1993-07-03T16:00:00.000+00:00" 格式(后台使用的是FastJson1版本)
期待的正确结果
能够对 "1993-07-03T16:00:00.000+00:00" 正确进行反序列化
相关日志输出
附加信息
看代码是在 com.alibaba.fastjson2.util.JdbcSupport :
The text was updated successfully, but these errors were encountered: