FastJSON序列化特殊字符BUG



java.lang.StackOverflowError
	sun.misc.FloatingDecimal.dtoa(FloatingDecimal.java:541)
	sun.misc.FloatingDecimal.(FloatingDecimal.java:468)
	java.lang.Double.toString(Double.java:196)
	com.alibaba.fastjson.serializer.DoubleSerializer.write(DoubleSerializer.java:64)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_5.write1(Unknown Source)
	Serializer_5.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_4.write1(Unknown Source)
	Serializer_4.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_5.write1(Unknown Source)
	Serializer_5.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_4.write1(Unknown Source)
	Serializer_4.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_5.write1(Unknown Source)
	Serializer_5.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_4.write1(Unknown Source)
	Serializer_4.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_5.write1(Unknown Source)
	Serializer_5.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_4.write1(Unknown Source)
	Serializer_4.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_5.write1(Unknown Source)
	Serializer_5.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_4.write1(Unknown Source)
	Serializer_4.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_5.write1(Unknown Source)
	Serializer_5.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_4.write1(Unknown Source)
	Serializer_4.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_5.write1(Unknown Source)
	Serializer_5.write(Unknown Source)
	com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:398)
	Serializer_4.write1(Unknown Source)
	Serializer_4.write(Unknown Source)

这是一个序列化问题,当实体类配置一对多,对应的实体类也配置多对一的时候,出现反复序列化,导致内存溢出,

解决方法在多的一方加上@JSONField(serialize = false),让多的一方放弃序列化.

你可能感兴趣的:(java)