小白求助,java输入流问题

我有好几个方法每个里面都用到了sc.write(s);这个写入的方法,我在主函数里调用这些方法,结果报出:
Exception in thread "main" org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save: an error occurs while saving the package : The part /docProps/app.xml fail to be saved in the stream with marshaller org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller@4fbf1942
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.UseProcessSum(UseProcess.java:198)
at test.TestMain.main(TestMain.java:42)
Caused by: org.apache.poi.openxml4j.exceptions.OpenXML4JException: The part /docProps/app.xml fail to be saved in the stream with marshaller org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller@4fbf1942
at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:494)
... 4 more

我只执行一个方法就没事,我该怎么办啊?

3个回答

at test.UseProcess.UseProcessSum(UseProcess.java:198)
at test.TestMain.main(TestMain.java:42)
看看这两句有没有问题

是不是把写文件和关闭流放在循环里面了

能不能把test M ai n程序发来看看。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问