The problem of generics in springboot return structure

public class Result<T> {

    private int code;

    private String msg;

    private T body;
    

I have a generic type in my return structure definition, and then an error occurs when springboot returns

"No converter found for return value of type: class net.zjump.throwbookserver.bean.Result"

how to solve it!

Mar.12,2021

is not a generic problem, and the error is clear: the converter was not found. There are many common XML and JSON, converters. If you are JSON, check to see if you have added corresponding converters to your POM dependency: jackson-core and jackson-databind.

  1. if there is spring-boot-starter-web , the jackson converter is already included.
  2. whether it is a POJO (get set method or not)
  3. Whether the
  4. annotation is @ RestController

did not write the getset method

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dff2-2bc2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dff2-2bc2f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?