No converter found for return value of type: class com.springboot.springbootdemo.config.JsonResult
废话不多说,原因是因为controller类中的请求的方法中返回的对象缺少get、set方法,
@GetMapping(value = "/allTUser")
@ResponseBody
public JsonResult allTUser(){
return new JsonResult<>();
}
就好比我这,原因是因为JsonResult类中没有get、set方法,直接使用@Data注解
如果还报错检查是否有导Jackson的全家桶
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.11.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.11.1</version>
</dependency>
好了问题解决,欢迎补充