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
分析是List modules更改了。
只有多处地方调用了 JSON.parseObject同一个类,怀疑跟类加载器不一致相关。
代码片段,在多线程的环境下执行偶现ConcurrentModificationException。
Utils.useFunctionClassLoader();
T val = (T) JSON.parseObject(new String(bytes, StandardCharsets.UTF_8), this.type,
JSONReader.Feature.SupportAutoType, JSONReader.Feature.SupportClassForName);
Utils.useInstanceClassLoader();
return val;
报错堆栈信息。
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.base/java.util.ArrayList$Itr.next(Unknown Source)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getFieldInfo(ObjectReaderProvider.java:675)
at com.alibaba.fastjson2.reader.ObjectReaderCreator.createFieldReader(ObjectReaderCreator.java:1234)
at com.alibaba.fastjson2.reader.ObjectReaderCreator.lambda$createFieldReaders$3(ObjectReaderCreator.java:1555)
at com.alibaba.fastjson2.util.BeanUtils.declaredFields(BeanUtils.java:307)
at com.alibaba.fastjson2.util.BeanUtils.declaredFields(BeanUtils.java:242)
at com.alibaba.fastjson2.reader.ObjectReaderCreator.createFieldReaders(ObjectReaderCreator.java:1549)
at com.alibaba.fastjson2.reader.ObjectReaderCreatorASM.createObjectReader(ObjectReaderCreatorASM.java:259)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReaderInternal(ObjectReaderProvider.java:854)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReader(ObjectReaderProvider.java:746)
at com.alibaba.fastjson2.JSONReader.getObjectReader(JSONReader.java:480)
at com.alibaba.fastjson2.reader.FieldReaderObject.getObjectReader(FieldReaderObject.java:70)
at com.alibaba.fastjson2.reader.ORG_6_3_JeDraftTransferVO.readObject(Unknown Source)
at com.alibaba.fastjson2.reader.ORG_3_9_JeDraftMsgVO.readObject(Unknown Source)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1002)
at com.huawei.dff.functions.runtime.serde.MsgpackSerDe.deserialize(MsgpackSerDe.java:33)
at com.huawei.dff.functions.runtime.serde.SerDeInstanceUtils.deserializeMessage(SerDeInstanceUtils.java:56)
at com.huawei.dff.functions.runtime.io.yuanrong.YuanRongSource.lambda$processDeseqialize$0(YuanRongSource.java:229)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
环境信息
请填写以下信息:
OS信息: [e.g.:CentOS 8.4.2105 4Core 3.10GHz 16 GB]
JDK信息: [e.g.:Openjdk 1.8.0_312]
版本信息:[e.g.:Fastjson2 2.x.x]
重现步骤
如何操作可以重现该问题:
使用 xxx.xxx 方法
输入 ... 数据
出现 ... 错误
//可在此输入示例代码
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
相关日志输出
请复制并粘贴任何相关的日志输出。
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered:
问题描述
分析是List modules更改了。
只有多处地方调用了 JSON.parseObject同一个类,怀疑跟类加载器不一致相关。
代码片段,在多线程的环境下执行偶现ConcurrentModificationException。
Utils.useFunctionClassLoader();
T val = (T) JSON.parseObject(new String(bytes, StandardCharsets.UTF_8), this.type,
JSONReader.Feature.SupportAutoType, JSONReader.Feature.SupportClassForName);
Utils.useInstanceClassLoader();
return val;
报错堆栈信息。
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.base/java.util.ArrayList$Itr.next(Unknown Source)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getFieldInfo(ObjectReaderProvider.java:675)
at com.alibaba.fastjson2.reader.ObjectReaderCreator.createFieldReader(ObjectReaderCreator.java:1234)
at com.alibaba.fastjson2.reader.ObjectReaderCreator.lambda$createFieldReaders$3(ObjectReaderCreator.java:1555)
at com.alibaba.fastjson2.util.BeanUtils.declaredFields(BeanUtils.java:307)
at com.alibaba.fastjson2.util.BeanUtils.declaredFields(BeanUtils.java:242)
at com.alibaba.fastjson2.reader.ObjectReaderCreator.createFieldReaders(ObjectReaderCreator.java:1549)
at com.alibaba.fastjson2.reader.ObjectReaderCreatorASM.createObjectReader(ObjectReaderCreatorASM.java:259)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReaderInternal(ObjectReaderProvider.java:854)
at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReader(ObjectReaderProvider.java:746)
at com.alibaba.fastjson2.JSONReader.getObjectReader(JSONReader.java:480)
at com.alibaba.fastjson2.reader.FieldReaderObject.getObjectReader(FieldReaderObject.java:70)
at com.alibaba.fastjson2.reader.ORG_6_3_JeDraftTransferVO.readObject(Unknown Source)
at com.alibaba.fastjson2.reader.ORG_3_9_JeDraftMsgVO.readObject(Unknown Source)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1002)
at com.huawei.dff.functions.runtime.serde.MsgpackSerDe.deserialize(MsgpackSerDe.java:33)
at com.huawei.dff.functions.runtime.serde.SerDeInstanceUtils.deserializeMessage(SerDeInstanceUtils.java:56)
at com.huawei.dff.functions.runtime.io.yuanrong.YuanRongSource.lambda$processDeseqialize$0(YuanRongSource.java:229)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
xxx.xxx
方法...
数据...
错误//可在此输入示例代码
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
相关日志输出
请复制并粘贴任何相关的日志输出。
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered: