2 sinat 33415638 sinat_33415638 于 2016.03.03 10:15 提问

我想将文件输出到C盘,可是会出以下异常,输出到d盘就没事

Exception in thread "main" org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save: an error occurs while saving the package : null
at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:503)
at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1467)
at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:217)
at test.UseProcess.createWorkbook(UseProcess.java:312)
at test.TestMain.main(TestMain.java:48)
Caused by: java.lang.NullPointerException
at java.util.zip.DeflaterOutputStream.(DeflaterOutputStream.java:84)
at java.util.zip.DeflaterOutputStream.(DeflaterOutputStream.java:142)
at java.util.zip.ZipOutputStream.(ZipOutputStream.java:118)
at java.util.zip.ZipOutputStream.(ZipOutputStream.java:104)
at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:435)
... 4 more

1个回答

u012263331
u012263331   2016.03.03 10:34
已采纳

明显的空指针:Exception in thread "main" org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save: an error occurs while saving the package : null
Caused by: java.lang.NullPointerException
是不是你指定的路径不存在,或者权限问题

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!