json报错 | com.alibaba.fastjson.JSONException: illegal identifier : \pos 1, line 1, column 2
2021-01-18 05:13
标签:解决方案 inter join object $$ lib ati 方案 except 将json字符串处理对json对象时报错如下: 原字符串为: 报错原因是,在json反序列化时存在转义字符。 json报错 | com.alibaba.fastjson.JSONException: illegal identifier : \pos 1, line 1, column 2 标签:解决方案 inter join object $$ lib ati 方案 except 原文地址:https://www.cnblogs.com/waiting-ying/p/13354352.htmlcom.alibaba.fastjson.JSONException: illegal identifier : \pos 1, line 1, column 2
at com.alibaba.fastjson.parser.JSONLexerBase.scanSymbolUnQuoted(JSONLexerBase.java:830) ~[fastjson-1.2.59.jar:?]
at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:286) ~[fastjson-1.2.59.jar:?]
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1394) ~[fastjson-1.2.59.jar:?]
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1360) ~[fastjson-1.2.59.jar:?]
at com.alibaba.fastjson.JSON.parse(JSON.java:165) ~[fastjson-1.2.59.jar:?]
at com.alibaba.fastjson.JSON.parse(JSON.java:175) ~[fastjson-1.2.59.jar:?]
at com.alibaba.fastjson.JSON.parse(JSON.java:144) ~[fastjson-1.2.59.jar:?]
at com.alibaba.fastjson.JSON.parseObject(JSON.java:236) ~[fastjson-1.2.59.jar:?]
at com.fline.zjsecurity.mgmt.service.impl.DecryptTaskMgmtServiceImpl.decryptInterfaceData(DecryptTaskMgmtServiceImpl.java:359) ~[classes/:?]
at com.fline.zjsecurity.mgmt.service.impl.DecryptTaskMgmtServiceImpl.decryptData(DecryptTaskMgmtServiceImpl.java:195) ~[classes/:?]
at com.fline.zjsecurity.mgmt.service.impl.DecryptTaskMgmtServiceImpl$$FastClassBySpringCGLIB$$6155c3a7.invoke(
{\"AAC001\":\"d24b8cf9a7933142\",\"AAC003\":\"a9d24c17fa430a9\",\"AAC004\":\"6fabd7627c8de65f8336eef02fd09d1b80b00000058009558678838c4405c06\"}
解决方案:在处理字符串之前,先将字符串去除转义 StringEscapeUtils.unescapeJava(String data)
文章标题:json报错 | com.alibaba.fastjson.JSONException: illegal identifier : \pos 1, line 1, column 2
文章链接:http://soscw.com/index.php/essay/43527.html