问题一:

JSON parse error: Cannot deserialize instance of java.util.ArrayList<java.lang.Object> out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList<java.lang.Object> out of START_OBJECT token
at [Source: (PushbackInputStream); line: 1, column: 1]

原因:

参数字段不匹配,比如我这里写的后端接口接受的参数是数组(@RequestBody List< String> customers),但是传参又是一个json数据,没对应好(如下图

在这里插入图片描述

解决方法:

数组应该这样子传

在这里插入图片描述

问题二:

Content type ‘text/plain;charset=UTF-8’ not supported

测试接口时,postman:

在这里插入图片描述

后端:

在这里插入图片描述

只需要在请求的请求头上设置Content-Type为application/json就行

在这里插入图片描述

问题三:

The error may involve defaultParameterMap
The error occurred while setting parameters
Cause: java.sql.SQLSyntaxErrorException: Duplicate column name ‘id’; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Duplicate column name ‘id’

在这里插入图片描述

原因:

连接了多个表都带有id,而我又为了省事直接select *,

解决方法:

要哪些数据就拿那些数据,而我只需要某一张表的字段加上其他表的几个字段就可以用select 表名.星,表名.字段获取

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐