实测无效
public static void main(String[] args) {
String path = "L:\\test\\1001-0001-0001-库存现金明细余额表 - 副本.xlsx";
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(path);
Workbook wk = new Workbook();
wk.open(fis);
fos = new FileOutputStream(path);
wk.save(fos);
} catch (Exception e) {
ThrowExceptionUtils.doThrow(e);
} finally {
BaseCommonUtils.closeDgWorkpaperStream(fis, fos, null);
}
}
Connected to the target VM, address: '127.0.0.1:54717', transport: 'socket'
Exception in thread "main" 发生异常了。
类名:cn.com.bdo.base.exception.BaseException
错误信息:java.lang.IllegalArgumentException: java.lang.NullPointerException
详细信息:java.lang.IllegalArgumentException: java.lang.NullPointerException
at cn.com.bdo.base.utils.ThrowExceptionUtils.doThrow(ThrowExceptionUtils.java:23)
at cn.com.bdo.dgCenter.service.GcExcelService.main(GcExcelService.java:2225)
Caused by: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.NullPointerException
at com.grapecity.documents.excel.o.c.L.a(Unknown Source)
at com.grapecity.documents.excel.Workbook.a(Unknown Source)
at com.grapecity.documents.excel.Workbook.save(Unknown Source)
at cn.com.bdo.dgCenter.service.GcExcelService.main(GcExcelService.java:2223)
Caused by: java.lang.IllegalArgumentException: java.lang.NullPointerException
at com.grapecity.documents.excel.o.c.az.a(Unknown Source)
... 4 more
Caused by: java.lang.NullPointerException
at com.grapecity.documents.excel.o.c.c.a(Unknown Source)
at com.grapecity.documents.excel.o.c.az.a(Unknown Source)
at com.grapecity.documents.excel.o.c.az.a(Unknown Source)
at com.grapecity.documents.excel.o.c.az.c(Unknown Source)
... 5 more
Disconnected from the target VM, address: '127.0.0.1:54717', transport: 'socket'
测试文件请备份后再测试
|
|