Bug 59356 - log printed message: this error should NEVER happen! Please raise a bug at https://bz.apache.org/bugzilla/enter_bug.cgi?product=POI
Summary: log printed message: this error should NEVER happen! Please raise a bug at ht...
Status: RESOLVED DUPLICATE of bug 59634
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.15-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-19 17:08 UTC by scorpdaddy
Modified: 2016-12-01 03:34 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description scorpdaddy 2016-04-19 17:08:05 UTC
• read workbook from file
• workbook.close()
• made changes in a sheet in workbook
• workbook.write(FileOutputStream to original file)
Failed on workbook.write(os);

Can't upload file because it is 10x the upload limit.



<logsnippet>

ERROR(NhlDayAnalysis) 2016-04-19 13:58:35.507: com.shiftenergy.nhlDayAnalysis.SmoothZoneTemps.run() failed
Exception: org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException
Rule M2.4 exception : this error should NEVER happen! Please raise a bug at https://bz.apache.org/bugzilla/enter_bug.cgi?product=POI and attach a file that triggers it, thanks!

org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Rule M2.4 exception : this error should NEVER happen! Please raise a bug at https://bz.apache.org/bugzilla/enter_bug.cgi?product=POI and attach a file that triggers it, thanks!
	at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.getContentType(ContentTypeManager.java:343)
	at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.removeContentType(ContentTypeManager.java:256)
	at org.apache.poi.openxml4j.opc.OPCPackage.removePart(OPCPackage.java:975)
	at org.apache.poi.openxml4j.opc.PackagePart.getOutputStream(PackagePart.java:522)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.commit(XSSFWorkbook.java:1677)
	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:464)
	at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:193)
	at com.shiftenergy.nhlDayAnalysis.SmoothZoneTemps.run(SmoothZoneTemps.java:101)
	at java.lang.Thread.run(Thread.java:745)



</logsnippet>
Comment 1 Dominik Stadler 2016-05-17 19:33:11 UTC
Hmm, not much chance to reproduce this without the actual code and a file that reproduces it. Is it still happening if you delete some stuff from the sample-file?
Comment 2 Dominik Stadler 2016-07-26 05:54:21 UTC
In r1753912 we clarified the JavaDoc of the close() method to state that you should not use the object any more after calling close(), so the "fix" here is likely to not call close() until you are done with the file.

*** This bug has been marked as a duplicate of bug 59634 ***