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
[BUG]class com.alibaba.fastjson2.JSONObject cannot be cast to class com.alibaba.fastjson.JSONObject (com.alibaba.fastjson2.JSONObject and com.alibaba.fastjson.JSONObject are in unnamed module of loader 'app')
#2673
Closed
gavinxzw opened this issue
Jun 6, 2024
· 2 comments
请复制并粘贴任何相关的日志输出。
Exception in thread "main" java.lang.ClassCastException: class com.alibaba.fastjson2.JSONObject cannot be cast to class com.alibaba.fastjson.JSONObject (com.alibaba.fastjson2.JSONObject and com.alibaba.fastjson.JSONObject are in unnamed module of loader 'app')
at com.efuture.ocp.common.JsonToBean.main(JsonToBean.java:17)
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered:
问题描述
简要描述您碰到的问题。
使用兼容1.x进行javabean转换时出现不是预期的
com.alibaba.fastjson.JSONObject
而是变成com.alibaba.fastjson2.JSONObject
请看代码例子
环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
xxx.xxx
方法...
数据...
错误//可在此输入示例代码
package com.efuture.ocp.common;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
public class JsonToBean {
}
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
期望的data应该解释成com.alibaba.fastjson.JSONObject
相关日志输出
请复制并粘贴任何相关的日志输出。
Exception in thread "main" java.lang.ClassCastException: class com.alibaba.fastjson2.JSONObject cannot be cast to class com.alibaba.fastjson.JSONObject (com.alibaba.fastjson2.JSONObject and com.alibaba.fastjson.JSONObject are in unnamed module of loader 'app')
at com.efuture.ocp.common.JsonToBean.main(JsonToBean.java:17)
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered: