添加到我的DTO对象后,我想将一个列表发送到服务器
private ImmutableList<T> elementsToAdd;
这
import com.google.common.collect.ImmutableList;
将对象发送到控制器时会抛出
2018-06-04 21:41:31.645 WARN 508 --- [nio-8443-exec-6] .c.j.MappingJackson2HttpMessageConverter : Failed to evaluate Jackson deserialization for type [[simple type, class com.jonki.popcorn.common.dto.request.ContributionNewRequest<com.jonki.popcorn.common.dto.movie.Language>]]: com.fasterxml.jackson.databind.JsonMappingException: Cannot find a deserializer for non-concrete Collection type [collection type; class com.google.common.collect.ImmutableList, contains [simple type, class com.jonki.popcorn.common.dto.movie.Language]]
答案 0 :(得分:1)
您需要配置Jackson,以便它可以序列化/反序列化Guava的可变集合。请参阅https://github.com/FasterXML/jackson-datatypes-collections/tree/master/guava。