Bug 59812 - org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Rule M2.4 exception
Summary: org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Rule M2.4 exce...
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2016-07-06 15:33 UTC by barker.alvine
Modified: 2021-07-09 17:58 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description barker.alvine 2016-07-06 15:33:41 UTC
Exception in thread "main" 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:958)
	at org.apache.poi.openxml4j.opc.PackagePart.getOutputStream(PackagePart.java:522)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.commit(XSSFWorkbook.java:1687)
	at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:464)
	at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:211)
	at barker.alvine.staff.FileWrite.addItem(FileWrite.java:273)
	at barker.alvine.inventory.Order.getOrderDetails(Order.java:83)
	at barker.alvine.staff.User.getOption(User.java:47)
	at barker.alvine.access.Login.start(Login.java:47)
	at TestPackages.main(TestPackages.java:7)
Comment 1 Javen O'Neal 2016-07-06 15:41:06 UTC
Could you take look at bug 59806? This bug had the same stack trace and was caused by trying to use objects after the workbook/slideshow/document/etc was closed.

Make sure your code isn't using resources after they are closed.

If this is not the case, you will need to provide a *minimal* code sample and likely the workbook that caused the problem.
Comment 2 Dominik Stadler 2016-07-15 18:48:35 UTC
Also what about the "and attach a file that triggers it" part of the error message?
Comment 3 Dominik Stadler 2016-07-22 12:49:44 UTC
Please reopen this bug if you can provide some more information here, currently there is not much we can do without the actual file that triggers this.