Summary: | Writing a workbook twice throws XmlValueDisconnectedException | ||
---|---|---|---|
Product: | POI | Reporter: | Vinu Kumar <vinu.kumar> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | geraldolmr, onealj, pbtura |
Priority: | P2 | ||
Version: | 3.7-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
Repro file for the issue
xlsx file used for testing |
Created attachment 23225 [details]
xlsx file used for testing
Same for me here. I need to mark some cells in a sheet already open and save it to a new file to download it so the user can see the modifications she's doing on the seet. If it's a xls workbook, all goes well but when I have a xlsx workbook, this exception is thrown. So, as a workarround, I have to read the workbook all over again everytime I need to mark and save it (and keep track of all the modifications to apply them in each iteration). It adds an unnecessary overhead to the process, so I'd like to see it solved asap. I think this might be an xmlbeans bug - it doesn't look to me like we're doing anything wrong Can you try a newer version of xmlbeans and see if it fixes it? I was seeing this same issue in one of my projects. I tried replacing the xmlbeans jar with the latest version (2.5.0) and it had no effect. Even i am facing the similar problem. My project was working with xls (Excel 2003) but now we had to do changes to make it work with xlsx(Excel 2007). I added the required jars xmlbeans-2.3.0.jar, ooxml-schemas-1.1.jar, poi-3.7.jar, poi-ooxml-3.7-20101029.jar, dom4j-1.6.1.jar Can anybody please help with this issue??????? I am also facing the above problem; first time when i write in the workbook, it works fine but when second time i try writing in the workbook i get the XMLValueDisconnectedException!!! I have the required jars of poi,xmlbeans and dom4j jars Can anybody please suggest a solution for this problem????????? Similar problem as above; I am trying to create a new project working with xlsx. Also i have imported the required jars. But still getting the XMLValueDisconnectedException. Does anyone have a solution to this???? Please help!!! I am trying to use Excel 2007 (xlsx files), in my project, but i get the XMLValueDisconnectedException. I have imported the jars poi-ooxml-schemas-3.7, poi-3.7, poi-ooxml-3.7, xmlbeans-2.3 and dom4j jars Still i get that exception. Can anyone please look into this???? Thanks... Hi, My Project is Excel based application where loads of excel file data gets processed. Currently we are using Office 2003 version (.xls format), we now want to switch to Office 2007 (.xlsx format). But when we try to overwrite the .xls file to .xlsx file it gives 'XMLValueDisconnectedException' Error. We have tried numerous possibilities but nothing worked. It seems that it is related to POI JARs that we are using (POI 3.7). Could you please help us out in the solution for the above problem? as we need to migrate the project ASAP. Thanks in advance. Regards, Pravin A. Khavnekar Hi, There is a need for our applications to be comaptible with Excel 2007 along with 2003. We have a multiple write functionality and with the POI 3.7 using Workbook and WorkbookFactory class works fine for 2003 version but fails for 2007 version. We get an XMLValueDisconnectedException when we try to write the same workbook twice. Any help in this view is appreciated. Revert in case you need any further info. Regards, Ajay For those people who this bug affects, please remember that POI is a volunteer project. The quickest way to get a bug fixed is often to work on it yourself! There may be a xmlbeans bug here, or there may be a mistake in how POI is calling xmlbeans. Likely avenues for investigation are trying to come up with a much smaller set of code calling xmlbeans that triggers the problem (so a bug report can be raised with the xmlbeans project), and reviewing (likely with a debugger) the POI calls to xmlbeans to identify what is triggering the disconnection My Project is planning to use xlsx (Excel 2007) file ( previously used was xls (Excel 2003) ) so when we try to overwrite on the Xcel (xlsx file) for second time it gives XMLValueDisconnectedException Does any one have the solution for the above problem????” Hi, My Project is planning to use .xlsx file, previously used was .xls. so when i try to overwrite on the .xlsx file for the second time i am getting XMLValueDisconnectedException Thanks in advance, Revert in case you need any further info... Manoj R I have the same problem, it seems it hasnt been solved since i just downloaded the latest poi version 3.8 There are a number of bug reports for the same issue, duplicating this one to another one with more discussion. *** This bug has been marked as a duplicate of bug 49940 *** |
Created attachment 23224 [details] Repro file for the issue Read a xlsx file. Write the same workbook to two different file. Closing FileOutputStream after second write throws XmlValueDisconnectedException. org.apache.xmlbeans.impl.values.XmlValueDisconnectedException at org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1213) at org.apache.xmlbeans.impl.values.XmlObjectBase.newCursor(XmlObjectBase.java:243) at org.apache.xmlbeans.impl.values.XmlComplexContentImpl.arraySetterHelper(XmlComplexConten tImpl.java:1073) at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFontsImpl.setFontArray(Unknow n Source) at org.apache.poi.xssf.model.StylesTable.writeTo(StylesTable.java:323) at org.apache.poi.xssf.model.StylesTable.commit(StylesTable.java:381) at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:171) at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:173) at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:199) at com.mytest.xssftest.crxlsfile(xssftest.java:39) at com.mytest.xssftest.main(xssftest.java:24) Tested from latest svn trunk.