No content to map due to end-of-input jackson parser

前端 未结 11 1960
盖世英雄少女心
盖世英雄少女心 2020-12-23 19:00

I am getting this response from the server {\"status\":\"true\",\"msg\":\"success\"}

I am trying to parse this json string using Jackson parser library

11条回答
  •  滥情空心
    2020-12-23 19:14

    In my case the problem was caused by my passing a null InputStream to the ObjectMapper.readValue call:

    ObjectMapper objectMapper = ...
    InputStream is = null; // The code here was returning null.
    Foo foo = objectMapper.readValue(is, Foo.class)
    

    I am guessing that this is the most common reason for this exception.

提交回复
热议问题