bug处理记录:com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value at [Source:

2023-02-12,,,

1. 报错:

com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value at [Source: (PushbackInputStream); line: 2, column: 21]

2. 导致原因:

测试时是使用swagger测试接口的,下面的 bin 字段的值是复制过来的,bin 的值表面上看是有 空格 的存在,其实是一些 特殊字符, 删除掉特殊字符就可以解决报错了。

向接口中传递json如下

{
"bin": "B10-41-03 ", // 此字段值存在特殊字符问题导致的报错
"equipment": "RF",
"invtype": "T",
"isrecount": 0,
"uname": "RFShuyy",
"whnum": "DA1H"
}

3. 总结:

字段的值中,若存在 JsonUtil 无法识别的 特殊字符 时,或是后台接收数据对象的数据结构与传入json不一致导致的无法转换,会出现该报错。

只要仔细对照 接口中参数对象 及 传入的json,就可以解决此bug

bug处理记录:com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value at [Source:的相关教程结束。

《bug处理记录:com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value at [Source:.doc》

下载本文的Word格式文档,以方便收藏与打印。