【发布时间】:2016-01-27 01:52:07
【问题描述】:
我尝试调用一个接受列表的 url。
发送的数据是
{"contactAvailableIdList":["1"],"contactIdList":["2","3"]}
Method on the server
@RequestMapping(value = "/lodgers/{lodgerId}/associate/dissociate/contact", method = RequestMethod.PUT)
public void associateLodgerAndContact(@PathVariable("lodgerId") Long lodgerId, @RequestBody @Valid final List<Long> contactIdList, @RequestBody @Valid final List<Long> contactAvailableIdList) {
lodgerService.associateDissociateLodgerAndContact(lodgerId, contactIdList, contactAvailableIdList);
}
"{"timestamp":1445958336633,"status":400,"error":"Bad 请求","异常":"org.springframework.http.converter.HttpMessageNotReadableException","消息":"可以 未阅读文档:无法反序列化 java.util.ArrayList 的实例 [Source: 中的 START_OBJECT 令牌\n java.io.PushbackInputStream@5a1edae4;行:1,列:1];嵌套的 例外是 com.fasterxml.jackson.databind.JsonMappingException: Can 不在 START_OBJECT 中反序列化 java.util.ArrayList 的实例 令牌\n 在 [来源:java.io.PushbackInputStream@5a1edae4;线:1, 列:1]","路径":"/rest/lodgers/1/associate/dissociate/contact"}"
【问题讨论】:
标签: spring jackson spring-rest