更新时间:2021-07-11 17:19:16
既然你提到使用 Tomcat 9,就试着分享我最近的经验.
Since you mentioned using Tomcat 9, attempting to share my recent experience.
最近我遇到了类似的问题.升级到 Tomcat 9.0.31 后,我的一个测试用例对大型 JSON(小于 2 MB)进行 POST 时开始随机失败:
Recently I ran into similar issue. When upgraded to Tomcat 9.0.31, one of my test case which does a POST of a large JSON (little less than 2 MB) started failing randomly with:
JSON 解析错误:VALUE_STRING 中出现意外的输入结束;嵌套异常是 com.fasterxml.jackson.databind.JsonMappingException: Unexpected end-of-input in VALUE_STRING at [Source: (PushbackInputStream);行:1,列:17](通过参考链:com.abc.xyz ["str"]) - JSON 解析错误:VALUE_STRING 中的意外输入结束;嵌套异常是 com.fasterxml.jackson.databind.JsonMappingException: Unexpected end-of-input in VALUE_STRING at [Source: (PushbackInputStream);行:1,列:17](通过参考链:com.abc.xyz["str"])在
JSON parse error: Unexpected end-of-input in VALUE_STRING; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unexpected end-of-input in VALUE_STRING at [Source: (PushbackInputStream); line: 1, column: 17] (through reference chain: com.abc.xyz ["str"]) - JSON parse error: Unexpected end-of-input in VALUE_STRING; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unexpected end-of-input in VALUE_STRING at [Source: (PushbackInputStream); line: 1, column: 17] (through reference chain: com.abc.xyz["str"]) at
结果是 Tomcat 9.0.31 中存在导致此问题的错误.
Turns out that there was a bug in Tomcat 9.0.31 which caused this.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64202
迁移到 Tomcat 9.0.33 解决了我的问题.
Moving to Tomcat 9.0.33 solved my issue.
您是否也在使用 Tomcat 9.0.31?
Are you also using Tomcat 9.0.31?