触发场景描述 在本地、开发环境都能够正常导出excel文件 在测试环境中使用时无法正常导出 触发Bug的代码
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
fileName = URLEncoder.encode(fileName, "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), clazz)
.sheet("Sheet1")
.doWrite(datas);
提示的异常或者没有达到的效果
[2019-11-26 16:38:37.444] [http-nio-8068-exec-5] [ERROR] [] DirectJDKLog.log:175 - Servlet.service() for servlet [dispatcherServlet] in context with path [/ed/api] threw exception [Request processing failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 0] with root cause
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:340)
at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
at sun.font.CompositeGlyphMapper.