apache / apache/servicecomb-java-chassis
Caused by: com.fasterxml.jackson.core.JsonParseException: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 814
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 1
Description
微服务之间调用,A微服务用以下几种方式向B微服务发起请求,均报错
restTemplate.postForEntity(fullUrl, requestHttp, JSONObject.class);
restTemplate.postForEntity(fullUrl, requestHttp, String.class);
restTemplate.postForEntity(fullUrl, requestHttp, Object.class);
Caused by: com.fasterxml.jackson.core.JsonParseException: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens
at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 1, column: 2]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2337)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:710)
at com.fasterxml.jackson.core.base.ParserMinimalBase._throwInvalidSpace(ParserMinimalBase.java:688)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._skipWSOrEnd(UTF8StreamJsonParser.java:3012)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:724)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4684)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4586)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3601)
at org.apache.servicecomb.common.rest.codec.produce.ProduceJsonProcessor.doDecodeResponse(ProduceJsonProcessor.java:64)
at org.apache.servicecomb.common.rest.codec.produce.ProduceProcessor.decodeResponse(ProduceProcessor.java:76)
at org.apache.servicecomb.transport.rest.client.http.DefaultHttpClientFilter.extractResponse(DefaultHttpClientFilter.java:104)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the inter-service request using the three RestTemplate calls shown, then trace response decoding through ProduceJsonProcessor.doDecodeResponse and DefaultHttpClientFilter.extractResponse. Confirm what response content produces the CTRL-CHAR 31 error and document or fix the behavior so the response is decoded successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100