1、环境以及报错描述
1.1 环境
操作系统为中标麒麟、cpu 为国产鲲鹏服务器。 jdk为openjdk version 1.8.0._242
1.2 错误
com.alibaba.fastjson2.JSONException: syntax error : f
at com.alibaba.fastjson2.JSONReaderUTF16.readBoolValue(JSONReaderUTF16.java:6424)
at com.alibaba.fastjson2.JSONReader.readObject(JSONReader.java:2347)
at com.alibaba.fastjson2.JSONReader.readArray(JSONReader.java:2594)
at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:2142)
at com.alibaba.fastjson2.JSON.parse(JSON.java:67)
at com.alibaba.fastjson2.JSON.toJSON(JSON.java:3506)
at com.alibaba.fastjson2.JSON.toJSON(JSON.java:3469)
at com.alibaba.fastjson2.JSONObject.from(JSONObject.java:2028)
在windows上没有出现此问题,这个问题不是每次都出现
依赖fastjson的截图如下
2、排查问题过程
请求参数样例如下{"dataun":"0002020015001011","mlcd":"","uuid":null,"pdcd":"Y2023","bzcode":"DATJ","tt_id":"T2301","datas":[{"data":[{"pdcd":"Y2023","tb_un":"0002020015001011"},{"DA3_078":46,"DA3_028_01":37,"DA3_053":36,"DA3_054":637,"DA3_030_01":3.6,"DA3_029_01":962,"DA3_077":96,"DA3_076":1,"DA3_025_01":1,"DA3_027_01":1,"DA3_026_01":1,"DA3_041_01":4,"DA3_042_01":326,"DA3_053_01":33,"DA3_054_01":636,"PUB05":"xxxxx","PUB08":"xxx","PUB02":"xxx","PUB03":"075","PUB04":"422000","PUB01":"11430511MB10830639","PUB09":"XXX","DA3_076_01":1,"DA3_078_01":45,"DA3_091_01":"2","DA3_092_01":29,"DA3_093_01":35,"DA3_089_01":"2","DA3_025":1,"DA3_026":1,"DA3_090_01":"2","DA3_099_01":18,"DA3_098_01":18,"PUB10":"XX","DA3_098":18,"DA3_099":8,"DA3_041":6,"DA3_042":327,"DA3_093":5,"DA3_092":29,"DA3_027":1,"DA3_028":40,"DA3_029":963,"PUB07":"2023","DA3_030":3.8,"PUB06":"0739-5180709"}],"tt_ver_n":"01","ts_cd":"S03","hasml":false,"ts_un":"0","hasdata":false}],"noAftercal":true}
1、在本地环境同样的请求参数正常。
2、怀疑是fastjson 的bug,升级fastjson的版本。问题处理没有重现。继续深究在github看fastjosn2的issue ,终于发现了https://github.com/alibaba/fastjson2/issues/2210