触发场景描述 public static void main(String args[]) { System.out.println("Hello World!"); doExport("20191225"); } private static void doExport(String day) { String name = "模板15"; String templateFileName = FileUtil.getPath() + "demo" + File.separator + "fill" + File.separator + name + ".xlsx"; boolean isExists = new File(templateFileName).exists(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss"); String str = sdf.format(new Date()); String fileName = FileUtil.getPath() + name + " - " + str + ".xlsx"; String fileNameFinal = FileUtil.getPath() + name + "- 最后数据 - " + str + ".xlsx"; String imagePath = FileUtil.getPath() + name + str + ".png"; String imagePathFinal = FileUtil.getPath() + name + "- 最后数据 - " + str + ".png"; ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build(); }
描述: 1、doExport()方法在main()方法中执行正常,可以生成新的excel文件
- 通过接口访问(Controller->ServiceImpl)中调用doExport()方法,则失败(未生成新的excel文件,服务自动重启)。
触发Bug的代码 ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build();
**提示的异常或者没有达到的效果**
1.并没有生成新的excel文件,且会自动重启服务。
2.提示Shutting down ExecutorService 'applicationTaskExecutor'
[Thread-4 com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown initiated...
[Thread-4 com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown completed.