报错信息:
java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeHi(TimSort.java:899) at java.util.TimSort.mergeAt(TimSort.java:516) at java.util.TimSort.mergeForceCollapse(TimSort.java:457) at java.util.TimSort.sort(TimSort.java:254) at java.util.Arrays.sort(Arrays.java:1438) at com.bm.fastjson.util.TypeUtils.computeGetters(TypeUtils.java:1880) at com.bm.fastjson.util.TypeUtils.buildBeanInfo(TypeUtils.java:1820) at com.bm.fastjson.serializer.SerializeConfig.createJavaBeanSerializer(SerializeConfig.java:113) at com.bm.fastjson.serializer.SerializeConfig.getObjectWriter(SerializeConfig.java:821) at com.bm.fastjson.serializer.SerializeConfig.getObjectWriter(SerializeConfig.java:440) at com.bm.fastjson.serializer.JSONSerializer.getObjectWriter(JSONSerializer.java:448) at com.bm.fastjson.serializer.ListSerializer.write(ListSerializer.java:128) at com.bm.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:312) at com.bm.fastjson.JSON.toJSONString(JSON.java:793) at com.bm.fastjson.JSON.toJSONString(JSON.java:731) at com.bm.fastjson.JSON.toJSONString(JSON.java:688)
问题原因:fastjson的一个bug
解决方式:升级fastjson到1.2.79版本(https://github.com/alibaba/fastjson/releases/tag/1.2.79)