问题一:
json parse error: Cannot deserialize instance of
java.util.ArrayList<java.lang.Object>
out of START_OBJECT token; nested exception is ***.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.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 o***urred 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 表名.星,表名.字段获取