看了下日志是栈溢出:我尝试debug然后用json打印一下看看,然后你们用的json版本是哪个?我用你们的版本试试 2021-08-31 00:53:12 [catalina-exec-40] ERROR c.taobao.arthas.core.view.ObjectView -ObjectView draw error, object class: class java.util.ArrayList java.lang.StackOverflowError: null at com.alibaba.fastjson.serializer.SerializeWriter.writeStringWithDoubleQuote(SerializeWriter.java:832) at com.alibaba.fastjson.serializer.SerializeWriter.writeString(SerializeWriter.java:2185) at com.alibaba.fastjson.serializer.MiscCodec.write(MiscCodec.java:166) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149) at com.alibaba.fastjson.serializer.ListSerializer.write(ListSerializer.java:135) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470) ...
arthas中使用的toJSONString传入的对象是JSON ,前面应该是还包了其他对象吧,需要怎么排查呢? at com.alibaba.fastjson.JSON.toJSONString(JSON.java:687) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:676) at com.taobao.arthas.core.view.ObjectView.draw(ObjectView.java:45)
9条答案
按热度按时间tjrkku2a1#
有没有可能对象里面循环引用导致的,对象a里有对象b,对象b里面又有对象a
7fhtutme2#
检查下list里的对象,可能这些对象�本身转换为json就会StackOverflowError
klsxnrf13#
这个检查过了,用fastjson是不会出现这个问题的,并且不仅仅是一个接口有这种情况,我用到的所有的涉及到list的都会报这个错误
gudnpqoy4#
检查过了,是没有的
olqngx595#
检查 ~/logs/arthas/arthas.log
gz5pxeao6#
看了下日志是栈溢出:我尝试debug然后用json打印一下看看,然后你们用的json版本是哪个?我用你们的版本试试
2021-08-31 00:53:12 [catalina-exec-40] ERROR c.taobao.arthas.core.view.ObjectView -ObjectView draw error, object class: class java.util.ArrayList
java.lang.StackOverflowError: null
at com.alibaba.fastjson.serializer.SerializeWriter.writeStringWithDoubleQuote(SerializeWriter.java:832)
at com.alibaba.fastjson.serializer.SerializeWriter.writeString(SerializeWriter.java:2185)
at com.alibaba.fastjson.serializer.MiscCodec.write(MiscCodec.java:166)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149)
at com.alibaba.fastjson.serializer.ListSerializer.write(ListSerializer.java:135)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:470)
...
jfewjypa7#
https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md#%E5%BC%80%E5%8F%91%E8%80%85%E7%9B%B8%E5%85%B3
hmtdttj48#
我远程debug然后获取入参数中的list参数,使用JSON.toJSONString() 方法进行序列化是成功的。
arthas中使用的toJSONString传入的对象是JSON ,前面应该是还包了其他对象吧,需要怎么排查呢?
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:687)
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:676)
at com.taobao.arthas.core.view.ObjectView.draw(ObjectView.java:45)
lkaoscv79#
watch命令默认打印的是
{params, target, returnObj}
, 可以测试下不同的参数。