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.
Read More:
- [Solved] Scala error: type mismatch; found : java.util.List[?0] required: java.util.List[B]
- [Solved] org.apache.ibatis.executor.ExecutorException: No constructor found in void matching [java.lang.String]
- [Solved] Java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to java.util.List
- [Solved] Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- [Solved] Java.util.linkedhashmap cannot be cast to entity class
- [Solved] java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
- JAVA 8: How to Convert List to Map
- [How to Solve Error]java.util.Date cannot be cast to java.sql.Date
- [Solved] stream Convert list to map Error: java.lang.IllegalStateException: Duplicate key
- Error querying database. Cause: java.sql.SQLSyntaxErrorException: Expression #2 of SELECT list is no
- Android studio compilation failed: java.util.concurrent.ExecutionException: com.android.ide.common.process.Process
- [Solved] JSON parse error: Cannot deserialize instance of `java.util.ArrayList<..> out of START_OBJECT token;
- java.util.zip.zipexception: error in opening zip file
- Java will convert Excel to list set or JSON, export excel file to local, excel import and export, easyexcel tool class
- [Solved] Hibernate Error: java.lang.StackOverflowError at java.lang.Integer.toString(Integer.java:402)
- Solve the use of declaration transactions in spring java.lang.NoClassDefFoundError: org/aspectj/util/PartialOrder$PartialComparable
- Android solution Java.util.concurrent.ExecutionException: com.Android.ide.common.process.ProcessException: exception
- How to Fix Error Caused by: java.util.MissingResourceException: Can‘t find bundle for base name xxx, locale zh_CN
- List: How to de-duplication according to an attribute of an object
- [Solved] JSONUtil.toJsonStr() Error: org.springframework.web.util.NestedServletException: Handler dispatch failed…