com fasterxml jackson core JsonParseException

Intro com fasterxml jackson core JsonParseException

這篇介紹com fasterxml jackson core JsonParseException.

完整錯誤訊息及發生情境

1
2
3
4
5
6
7
8
9
10
在一個Redis Queue將String資料poll,並轉成instance時會
throw JsonParseException。
詳細錯誤為com.fasterxml.jackson.core.JsonParseException:
Illegal character ((CTRL-CHAR, code 4)):
only regular white space (\r, \n, \t) is allowed between tokens

原因是Redis的codec編碼
codec: !<org.redisson.codec.MarshallingCodec> {}
codec: !<org.redisson.client.codec.StringCodec> {}
兩邊設定錯誤,造成parse時編碼有問題造成JsonParseException。