Cannot deserialize instance of `java.lang.String` out of START_ARRAY token

记一次参数解析错误的解决.具体错误信息如下:

Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_ARRAY token
 at [Source: (PushbackInputStream); line: 2, column: 7] (through reference chain: java.util.LinkedHashMap["id"])]

看着是json转换异常,一时间就是不知道是那块的问题.后来一通搜索有说是请求参数解析报的这个错误.于是就F12逐步排查是哪个请求报的错误,以及对应controller接收的参数类型.
模拟案发现场如下:
Cannot deserialize instance of `java.lang.String` out of START_ARRAY token_第1张图片
Cannot deserialize instance of `java.lang.String` out of START_ARRAY token_第2张图片

于是乎,或者修改前台参数类型或者后台接收参数的类型,改正后示例如下:
Cannot deserialize instance of `java.lang.String` out of START_ARRAY token_第3张图片

你可能感兴趣的:(java)