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
Exception in thread "main" java.lang.StackOverflowError
at com.alibaba.fastjson2.writer.ObjectWriterProvider.getObjectWriter(ObjectWriterProvider.java:100)
at com.alibaba.fastjson2.JSONWriter.getObjectWriter(JSONWriter.java:379)
at com.alibaba.fastjson2.writer.FieldWriterObject.getObjectWriter(FieldWriterObject.java:49)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
....
The text was updated successfully, but these errors were encountered:
问题描述
序列化对象中含有
File
对象就会抛StackOverflowError
异常环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
SON.toJSONString
方法File
对象就会抛StackOverflowError
异常,期待的正确结果
fastjson1 可以序列化
相关日志输出
Exception in thread "main" java.lang.StackOverflowError
at com.alibaba.fastjson2.writer.ObjectWriterProvider.getObjectWriter(ObjectWriterProvider.java:100)
at com.alibaba.fastjson2.JSONWriter.getObjectWriter(JSONWriter.java:379)
at com.alibaba.fastjson2.writer.FieldWriterObject.getObjectWriter(FieldWriterObject.java:49)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
at com.alibaba.fastjson2.writer.ObjectWriter_1.write(Unknown Source)
....
The text was updated successfully, but these errors were encountered: