As all answers by other users got deleted, I am going to answer my own question. Thanks to the user that stated that this is an issue where jackson closes the input stream automatically.
The solution is to add JsonGenerator.Feature.AUTO_CLOSE_TARGET
to the configuration, and set it to false:
mapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);