1. 程式人生 > >spring boot jackon反序列化異常

spring boot jackon反序列化異常

1.Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token;

檢測到該欄位是string,而反序列化結果應該是list

2.Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value

該欄位為string,並且值中使用了反斜槓,所以提示儘量避免在JSON的string型別的value值中使用反斜槓。

3.com.fasterxml.jackson.databind.JsonMappingException Invalid UTF-8 middle byte 0xd6

接收的文字中有特殊字元,解析JSON的時候中斷了,如é,ò。原因是JSON編碼的時候編碼方式不正確,JSON編碼必須使用UTF-8,UTF-16或者UTF-32。