Apache OpenOffice (AOO) Bugzilla – Issue 65317
Files format is defected
Last modified: 2017-05-20 11:17:41 UTC
In different platform and OS (pc or server bi proc in windows XP or Linux) with more than 1GB ram and proc > 3GHz, the same error became after many operations on the same file. If I modified a files, for example change the textFields and save the document, or if I run the mailmerge service, when I do a loop in this little programs, original file is corrupt in many operations (2000 in windows and 500 in Linux). OOo run a widget with an error who say that "style.xml or content.xml can't be saved". After that, the document is corrupt and OOo is in an error state. Thanks. Starm
mmm ... looks more like a problem with the Writer than one with the UNO-API
Reassigned to ES.
Please attach a sample document and give an exact step by step description of what you modify in the document to reproduce this error.
Created attachment 36541 [details] Original file
Created attachment 36542 [details] corrupted file after work
I open OOo connexion with a socket, if you want how I do this, go : http://www.oooforum.org/forum/viewtopic.phtml?t=35602 First, I open the original document (odt), I change the properties of the fields (databasename and datatablename), and I save it. After, I call mailmerge service like this : Object mmservice = null; // Create an instance of the MailMerge service try { XMultiComponentFactory mxMCF = OOo.getMxMCF(); XComponentContext xComponentContext = OOo.getMxComponentContext(); mmservice = mxMCF.createInstanceWithContext("com.sun.star.text.MailMerge", xComponentContext); if (mmservice == null) { FichierLog.ecrire("OOoFusion.realiserFusion", "mmservice null", "I"); throw new OOoComponentException("OOoFusion.realiserFusion", "0", "mmservice null", "fr"); } } catch (Exception e) { FichierLog.ecrire("OOoFusion.realiserFusion", "Exception - " + e.getMessage(), "E"); throw new OOoException("OOoFusion.realiserFusion", "0", "Exception - " + e.getMessage(), "fr"); } // Get the XPropertySet interface of the mmservice object XPropertySet oObjProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, mmservice); if (oObjProps == null) { FichierLog.ecrire("OOoFusion.realiserFusion", "oObjProps null", "I"); throw new OOoComponentException("OOoFusion.realiserFusion", "0", "oObjProps null", "fr"); } try { // Set up the properties for the MailMerge command oObjProps.setPropertyValue("DataSourceName", mDataSourceName); oObjProps.setPropertyValue("Command", mTableName); oObjProps.setPropertyValue("CommandType", new Integer(com.sun.star.sdb.CommandType.TABLE)); oObjProps.setPropertyValue("OutputType", new Short((short) 2)); oObjProps.setPropertyValue("DocumentURL", mFileURL); oObjProps.setPropertyValue("OutputURL", repEnvoi); oObjProps.setPropertyValue("FileNamePrefix", nomFichierEnvoi); oObjProps.setPropertyValue("ActiveConnection",cxDB.getXConnection()); if (typeEnvoi.equalsIgnoreCase("pdf")) { // generation document au format pdf oObjProps.setPropertyValue("SaveFilter", "writer_pdf_Export"); } else if (typeEnvoi.equalsIgnoreCase("doc")) { oObjProps.setPropertyValue("SaveFilter", "MS Word 97"); } if (nbFichiersGeneres.equalsIgnoreCase("1")) { // generation d'un seul document oObjProps.setPropertyValue("SaveAsSingleFile", new Boolean(true)); } else { oObjProps.setPropertyValue("SaveAsSingleFile", new Boolean(false)); } } catch (UnknownPropertyException e1) { FichierLog.ecrire("OOoFusion.realiserFusion", "UnknownPropertyException - " + e1.getMessage(), "E"); throw new OOoException("OOoFusion.realiserFusion", "0", "UnknownPropertyException - " + e1.getMessage(), "fr"); } catch (PropertyVetoException e1) { FichierLog.ecrire("OOoFusion.realiserFusion", "PropertyVetoException - " + e1.getMessage(), "E"); throw new OOoException("OOoFusion.realiserFusion", "0", "PropertyVetoException - " + e1.getMessage(), "fr"); } catch (IllegalArgumentException e1) { FichierLog.ecrire("OOoFusion.realiserFusion", "IllegalArgumentException - " + e1.getMessage(), "E"); throw new OOoException("OOoFusion.realiserFusion", "0", "IllegalArgumentException - " + e1.getMessage(), "fr"); } catch (WrappedTargetException e1) { FichierLog.ecrire("OOoFusion.realiserFusion", "WrappedTargetException - " + e1.getMessage(), "E"); throw new OOoException("OOoFusion.realiserFusion", "0", "WrappedTargetException - " + e1.getMessage(), "fr"); } // Get XJob interface from MailMerge service and call execute on it XJob job = (XJob) UnoRuntime.queryInterface(XJob.class, mmservice); if (job == null) { FichierLog.ecrire("OOoFusion.realiserFusion", "job null", "I"); throw new OOoComponentException("OOoFusion.realiserFusion", "0", "job null", "fr"); } try { Boolean res = (Boolean) job.execute(new NamedValue[0]); return res.booleanValue(); } catch (IllegalArgumentException e3) { FichierLog.ecrire("OOoFusion.realiserFusion", "IllegalArgumentException - " + e3.getMessage(), "E"); throw new OOoException("OOoFusion.realiserFusion", "0", "IllegalArgumentException - " + e3.getMessage(), "fr"); } catch (Exception e3) { FichierLog.ecrire("OOoFusion.realiserFusion", "Exception - " + e3.getMessage(), "E"); throw new OOoException("OOoFusion.realiserFusion", "0", "Exception - " + e3.getMessage(), "fr"); } When I do this in a loop, nearly thousands times, OOo can't save the result file . OOo run a widget with an error who say that "style.xml or content.xml can't be saved". After that, the document is corrupt and OOo is in an error state.
ES->SW: looks yes a little bit like an API special task ;)
Created attachment 36648 [details] document with macro to perform the mailmerge
Created attachment 36649 [details] document that contains the mailmerge fields
To reproduce the behaviour: 1. store the attached document "mailmerge_loop" and "baseDoc" to your local disc 2. open the document "mailmerge_loop" and adjust the pathes in it 3. store the changed document 4. open the file "baseDoc" and make a change to the document 5. without saving the document "baseDoc" start the macro attached to "mailmerge_loop" This macro attempts to do a mailmerge 1000 times. After 502 of these runs the macro stops with an gerneral IO error followed by an IllegalArgumentException. 6. close the office => you are asked if you want to save the document "baseDoc" 7. press the save button => an error message appears telling you that the document can't be saved since there is a problem with the styles.xml
following release status meeting -> target 3.x
Reset assigne to the default "issues@openoffice.apache.org".