JsonParseException: Unrecognized token 'http': was expecting ('true', 'false' or 'null')

前端 未结 4 1723
有刺的猬
有刺的猬 2021-01-04 06:10

We have the following string which is a valid JSON written to a file on HDFS.

{  
  \"id\":\"tag:search.twitter.com,2005:564407444843950080\",
  \"objectTyp         


        
4条回答
  •  日久生厌
    2021-01-04 06:30

    We have the following string which is a valid JSON ...

    Clearly the JSON parser disagrees!

    However, the exception says that the error is at "line 1: column 9", and there is no "http" token near the beginning of the JSON. So I suspect that the parser is trying to parse something different than this string when the error occurs.

    You need to find what JSON is actually being parsed. Run the application within a debugger, set a breakpoint on the relevant constructor for JsonParseException ... then find out what is in the ByteArrayInputStream that it is attempting to parse.

提交回复
热议问题