[Bug 61987] New: Updating excel file opended OPCPackage throws: OpenXML4JRuntimeException: Rule M2.4 exception

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 61987] New: Updating excel file opended OPCPackage throws: OpenXML4JRuntimeException: Rule M2.4 exception

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61987

            Bug ID: 61987
           Summary: Updating excel file opended OPCPackage throws:
                    OpenXML4JRuntimeException: Rule M2.4 exception
           Product: POI
           Version: 3.16-FINAL
          Hardware: PC
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Created attachment 35669
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35669&action=edit
ExcelFileUpdateExample1.java

Exception in thread "main"
org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Rule M2.4
exception : this error should NEVER happen! If you can provide the triggering
file, then please raise a bug at
https://bz.apache.org/bugzilla/enter_bug.cgi?product=POI and attach the file
that triggers it, thanks!
        at
org.apache.poi.openxml4j.opc.internal.ContentTypeManager.getContentType(ContentTypeManager.java:340)
        at
org.apache.poi.openxml4j.opc.internal.ContentTypeManager.removeContentType(ContentTypeManager.java:253)
        at
org.apache.poi.openxml4j.opc.OPCPackage.removePart(OPCPackage.java:1016)
        at
org.apache.poi.openxml4j.opc.PackagePart.getOutputStream(PackagePart.java:526)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.commit(XSSFWorkbook.java:1832)
        at
org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:390)
        at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:242)
        at test.ExcelFileUpdateExample1.main(ExcelFileUpdateExample1.java:68)

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61987] Updating excel file opended with OPCPackage throws: OpenXML4JRuntimeException: Rule M2.4 exception

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61987

raja <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Updating excel file opended |Updating excel file opended
                   |OPCPackage throws:          |with OPCPackage throws:
                   |OpenXML4JRuntimeException:  |OpenXML4JRuntimeException:
                   |Rule M2.4 exception         |Rule M2.4 exception
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61987] Updating excel file opended with OPCPackage throws: OpenXML4JRuntimeException: Rule M2.4 exception

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61987

--- Comment #1 from raja <[hidden email]> ---
Created attachment 35670
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35670&action=edit
inputfile

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61987] Updating excel file opended with OPCPackage throws: OpenXML4JRuntimeException: Rule M2.4 exception

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61987

--- Comment #2 from Alain Fagot Bearez <[hidden email]> ---
Take care about the order you are closing the resources:


            FileOutputStream outputStream = new
FileOutputStream("JavaBooks.xlsx");
            workbook.write(outputStream);
            outputStream.close();
            workbook.close();

            //inputStream.close();
            pkg.close();


Otherwise you are trying to write into a package (document) that has been
closed.

This is a classical duplicate of
https://bz.apache.org/bugzilla/show_bug.cgi?id=60102

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]