Failed to instantiate java.util.List using constructor NO_CONSTRUCTOR with arguments
Report errors
MappingInstantiationException: Failed to instantiate java.util.List using constructor NO_CONSTRUCTOR with arguments
Reason
Entity classes mapped by a set in Mongo Library
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "a")
public class A {
private List<B> b; // this is list
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class B {
private String bb;
}
}
A data format of set
{
"_id" : ObjectId("62df884326d4311d9c80de8d"),
"b" : {
"bb" : "test" //this is object
}
}
Solution:
Modify entity classes or process problem data.