apache / apache/servicecomb-java-chassis

Jackson在处理字符串时存在长度限制,是否可以添加配置项,供业务控制其所能解析的字符传长度?

Open
#4,239 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
1.9k
Forks
814
Avg merge
8d 23h
Merged PRs (30d)
1

Description

当前遇到一个问题,是服务端返回的响应消息中,字符串长度过长,导致jackson解析失败
```
Caused by: com.fasterxml.jackson.core.exc.StreamConstraintsException: String length (20051112) exceeds the maximum length (20000000)
at com.fasterxml...core.StreamReadConstraints.validateStringLength:324
at com.fasterxml...util.ReadConstrainedTextBuffer.validateStringLength:27
at com.fasterxml...util.TextBuffer.finishCurrentSegment:939
at com.fasterxml...json.UTF8StreamJsonParser._finishString2:2584
at com.fasterxml...json.UTF8StreamJsonParser._finishAndReturnString:2560
at com.fasterxml...json.UTF8StreamJsonParser.getText:335
at com.fasterxml...jsonorg.JSONObjectDeserializer.deserialize:51
at com.fasterxml...jsonorg.JSONObjectDeserializer.deserialize:48
at com.fasterxml...jsonorg.JSONObjectDeserializer.deserialize:14
at com.fasterxml...deser.DefaultDeserializationContext.readRootValue:323
at com.fasterxml...databind.ObjectMapper._readMapAndClose:4825mas
at com.fasterxml...databind.ObjectMapper.readValue:3825
at org.apache...produce.ProduceJsonProcessor.doDecodeResponse:64
at org.apache...produce.ProduceProcessor.decodeResponse:76
at org.apache...http.DefaultHttpClientFilter.extractResponse:105
at org.apache...http.DefaultHttpClientFilter.afterReceiveResponse:139
at org.apache...http.RestClientInvocation.lambda$processResponseBody$7:251
```
20000000是jackson提供的默认值;从chassis源码中来看,并没有提供配置该长度的配置项,是否可以加一个

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.