首页IT科技unable to serialize to json(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:)

unable to serialize to json(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:)

时间2025-06-20 20:53:10分类IT科技浏览4141
导读:1. 报错: com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 9 : has to be escaped using backslash to be included i...

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

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
异步加载 js 会阻塞什么(JS面试之异步模拟超时重传机制详解)