JSON parse error: Cannot construct instance of `com.request.ApplyRequest$Detail` (although at least one Creator exists): can only instantiate non-static inner class by using default, no-argument constructor; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.request.ApplyRequest$Detail` (although at least one Creator exists): can only instantiate non-static inner class by using default, no-argument constructor\n at [Source: (PushbackInputStream); line: 8, column: 13] (through reference chain: com.request.ApplyRequest[\"detailList\"]->java.util.ArrayList[0])
The problem appears: can only instantiate non-static inner class by using default
When you declare an inner class as an attribute of the current class, you need to make the inner class static, otherwise it won’t be loaded during class loading!
Solution: Declare the inner class as static directly!
Read More:
- [Solved] JSON parse error: Cannot deserialize instance of `java.util.ArrayList<..> out of START_OBJECT token;
- [Solved] org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot
- [Solved] HttpMessageNotReadableException: JSON parse error: Unrecognized field “xxxx“
- org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deseria
- JSON parse error: invalid UTF-8 solution series [How to Solve]
- [Solved] SpringBoot Date Convert Error: JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime`
- [Solved] Feign Call Port Error: HttpMessageNotReadableException:JSON parse error:Illegal character ((CTRL-CHAR, code 31)
- OpenFeign Error: {“code“:1,“msg“:“JSON parse error: Illegal character ((CTRL-CHAR, code 31))
- Java Error: No enclosing instance of type Main is accessible. Must qualify the allocation with an encl
- JAVA Error Illegal access: this web application instance has been stopped already. Could not load net.sf
- Byte 1 of UTF-8 sequence of error creating document instance. And bytes is invalid
- Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber
- TomcatJSON parse error: Invalid UTF-8 [How to Solve]
- [Solved] mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.
- Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.
- How to Solve SSM JSON Chinese Messy Code Issue
- JAVA: How to Read JSON Format Data (Web Game Development)
- [Solved] Mybatis Error: Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.
- [Solved] springsecurity custom exceptions: Error: Parse Error: Response overflow
- [Solved] org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class