Closed mineYso closed 2 months ago
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.52-SNAPSHOT/ 问题已修复,请用2.0.52-SNAPSHOT版本帮忙验证
你好!
非常感谢,使用最新快照分支验证,报告的问题已修复了。
在 2024-06-07 07:19:20,"Shaojin Wen" @.***> 写道:
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.52-SNAPSHOT/ 问题已修复,请用2.0.52-SNAPSHOT版本帮忙验证
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
问题描述
使用FastJson1.x的api出现2.x的转型失败异常。
环境信息
重现步骤
如何操作可以重现该问题:
期待的正确结果
能正常输出List信息,不再抛出转型异常
相关日志输出
java.lang.ClassCastException: class com.alibaba.fastjson.JSONObject cannot be cast to class com.alibaba.fastjson2.JSONObject (com.alibaba.fastjson.JSONObject and com.alibaba.fastjson2.JSONObject are in unnamed module of loader 'app') at com.alibaba.fastjson2.reader.ObjectReaderImplList.createInstance(ObjectReaderImplList.java:302) at com.alibaba.fastjson2.reader.ObjectReader.createInstance(ObjectReader.java:37) at com.alibaba.fastjson.JSONArray.toJavaObject(JSONArray.java:877) at com.test.TestMain.testMap(TestUrl.java:165) at com.test.TestMain.main(TestUrl.java:115)
附加信息