添加到我的 DTO 对象后,我想将列表发送到服务器
private ImmutableList<T> elementsToAdd;
来自
import com.google.common.collect.ImmutableList;
将对象发送到 Controller 时会抛出异常
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]]
最佳答案
您需要配置 Jackson,以便它可以序列化/反序列化 Guava 不可变集合。请参阅https://github.com/FasterXML/jackson-datatypes-collections/tree/master/guava .
关于java - 无法评估 Jackson 反序列化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50687795/