You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
完整的异常堆栈:
com.alibaba.excel.exception.ExcelGenerateException: Can not close IO.
at com.alibaba.excel.context.WriteContextImpl.finish(WriteContextImpl.java:420)
at com.alibaba.excel.write.ExcelBuilderImpl.finish(ExcelBuilderImpl.java:99)
at com.alibaba.excel.ExcelWriter.finish(ExcelWriter.java:143)
at com.alipay.xxxxx.biz.bill.impl.QueryBillServiceImpl.queryBill(QueryBillServiceImpl.java:116)
at com.alipay.xxxxx.biz.distributedtask.service.QueryBillDistributedTaskService.dispatchTasks(QueryBillDistributedTaskService.java:101)
at com.alipay.xxxxx.biz.task.ScheduledJob.onApplicationEvent(ScheduledJob.java:31)
at com.alipay.xxxxx.biz.task.ScheduledJob.onApplicationEvent(ScheduledJob.java:21)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at com.alipay.xxxxx.bootstrap.BootstrapApplication.main(BootstrapApplication.java:38)
Caused by: java.lang.NullPointerException: null
at com.alibaba.excel.metadata.csv.CsvWorkbook.write(CsvWorkbook.java:247)
at com.alibaba.excel.context.WriteContextImpl.finish(WriteContextImpl.java:381)
... 18 common frames omitted
The text was updated successfully, but these errors were encountered:
异常出现的case是输出文件格式为CSV,但是如果实际代码执行过程没有数据写入到CSV文件,则在执行excelWrite.finish()时会报上述异常;
完整的异常堆栈:
com.alibaba.excel.exception.ExcelGenerateException: Can not close IO.
at com.alibaba.excel.context.WriteContextImpl.finish(WriteContextImpl.java:420)
at com.alibaba.excel.write.ExcelBuilderImpl.finish(ExcelBuilderImpl.java:99)
at com.alibaba.excel.ExcelWriter.finish(ExcelWriter.java:143)
at com.alipay.xxxxx.biz.bill.impl.QueryBillServiceImpl.queryBill(QueryBillServiceImpl.java:116)
at com.alipay.xxxxx.biz.distributedtask.service.QueryBillDistributedTaskService.dispatchTasks(QueryBillDistributedTaskService.java:101)
at com.alipay.xxxxx.biz.task.ScheduledJob.onApplicationEvent(ScheduledJob.java:31)
at com.alipay.xxxxx.biz.task.ScheduledJob.onApplicationEvent(ScheduledJob.java:21)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at com.alipay.xxxxx.bootstrap.BootstrapApplication.main(BootstrapApplication.java:38)
Caused by: java.lang.NullPointerException: null
at com.alibaba.excel.metadata.csv.CsvWorkbook.write(CsvWorkbook.java:247)
at com.alibaba.excel.context.WriteContextImpl.finish(WriteContextImpl.java:381)
... 18 common frames omitted
The text was updated successfully, but these errors were encountered: