• 首页
  • 栏目
  • CRM
  • 使用EasyExcel导出数据时,出现No converter for [class com.ttfund.crm.model.ResultInfo] with preset ...

使用EasyExcel导出数据时,出现No converter for [class com.ttfund.crm.model.ResultInfo] with preset ...

  • 2021-11-30
  • Admin

1.异常日志

[http-nio-8012-exec-44] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [/crm] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.ttfund.crm.model.ResultInfo] with preset Content-Type 'application/vnd.ms-excel;charset=UTF-8'] with root cause 
org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.ttfund.crm.model.ResultInfo] with preset Content-Type 'application/vnd.ms-excel;charset=UTF-8'
  • 1
  • 2

2.异常原因
我在控制层返回对象为ResultInfo所以会出现这个异常,将返回对象改为void就可以解决这个问题
在这里插入图片描述

原文:https://blog.csdn.net/gkkljy/article/details/121631163

联系站长

QQ:769220720