This error is caused by the inconsistency between the incoming string and the class of the object when gson parses the JSON string into an object
Solution:
Either modify the background method and change the structure type of the return value to be consistent with the specified class;
Either modify the class structure of the foreground transformation. In short, the data to be parsed must correspond to the structure of the transformed instance
Similar Posts:
- Expected BEGIN_OBJECT but was BEGIN_ARRAY at line
- Using Vue + Axios: axios.post error: request failed with status code 400 is one of the solutions
- [How to Solve] Failed to convert value of type ‘java.lang.String’ to required type ‘java.util.Date’;
- [How to Solve] jackson not marked as ignorable
- How to Solve Datatable field value is empty Error
- Solutions to typeerror: expected string or bytes like object error
- Can not deserialize instance of java.lang.String out of START_OBJECT token
- Convert Object to List>, avoiding Unchecked cast: ‘java.lang.Object’ to ‘java.util.List
- [Solved] mapper.xml Error: java.lang.AbstractMethodError: Method oracle/jdbc/driver/OracleResultSetImpl.getNString(Ljava/lang/String;)Ljava/lang/String; is abstract,
- [Solved] IllegalArgumentException: object is not an instance of declaring class