---
title: "error on importing xml or csv file"
url: "https://openforis.support/questions/108/error-on-importing-xml-or-csv-file"
tags: ["collectearth"]
status: "accepted"
score: 0
answer_count: 3
asked: "2014-11-18T03:05:16"
last_activity: "2014-11-18T10:16:04"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# error on importing xml or csv file

Asked by alessioalfonsetti on 2014-11-18

Dear Support,

We are having issues at importing xml (or zip containing a set or xml file) just exported using Collect Earth.

Here is the log of the error:
ERROR 2014-11-18 14:52:55,148 [XML Import Thread 3.xml] org.openforis.collect.io.data.XMLDataImportProcess: error in opening zip file
java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at org.openforis.collect.io.data.XMLDataImportProcess.extractPackagedSurvey(XMLDataImportProcess.java:518)
	at org.openforis.collect.io.data.XMLDataImportProcess.createDataImportSummary(XMLDataImportProcess.java:152)
	at org.openforis.collect.io.data.XMLDataImportProcess.call(XMLDataImportProcess.java:136)
	at org.openforis.collect.earth.app.view.ImportXMLDialogProcessMonitor.startImport(ImportXMLDialogProcessMonitor.java:80)
	at org.openforis.collect.earth.app.view.ImportActionListener$1.run(ImportActionListener.java:76)
ERROR 2014-11-18 14:52:55,149 [XML Import Thread 1.xml] org.openforis.collect.io.data.XMLDataImportProcess: error in opening zip file
java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at org.openforis.collect.io.data.XMLDataImportProcess.extractPackagedSurvey(XMLDataImportProcess.java:518)
	at org.openforis.collect.io.data.XMLDataImportProcess.createDataImportSummary(XMLDataImportProcess.java:152)
	at org.openforis.collect.io.data.XMLDataImportProcess.call(XMLDataImportProcess.java:136)
	at org.openforis.collect.earth.app.view.ImportXMLDialogProcessMonitor.startImport(ImportXMLDialogProcessMonitor.java:80)
	at org.openforis.collect.earth.app.view.ImportActionListener$1.run(ImportActionListener.java:76)
ERROR 2014-11-18 14:54:06,996 [XML Import Thread 1.xml] org.openforis.collect.io.data.XMLDataImportProcess: error in opening zip file
java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at java.util.zip.ZipFile.<init>(Unknown Source)
	at org.openforis.collect.io.data.XMLDataImportProcess.extractPackagedSurvey(XMLDataImportProcess.java:518)
	at org.openforis.collect.io.data.XMLDataImportProcess.createDataImportSummary(XMLDataImportProcess.java:152)
	at org.openforis.collect.io.data.XMLDataImportProcess.call(XMLDataImportProcess.java:136)
	at org.openforis.collect.earth.app.view.ImportXMLDialogProcessMonitor.startImport(ImportXMLDialogProcessMonitor.java:80)
	at org.openforis.collect.earth.app.view.ImportActionListener$1.run(ImportActionListener.java:76)

Can you please advise?

Cheers,
Alessio


## Accepted answer (score 0, by Open Foris on 2014-11-18)

Link: https://openforis.support/questions/108/error-on-importing-xml-or-csv-file/116

So from further contact with this user:

The file he was trying to import looked like this when opened in WinRAR :

![alt text][1]


This means that the file he is trying to import is not the file generated though Collect Earth!

**The file generated by Collect Earth should have this structure:**

![alt text][2]

Where **idm.xml** is the survey definition and the folder **1** contains all of the plot information (there is an XML file per plot), which is in fact the contents of the first file shown ( the xmlfilelist 1,2,3,4 and so on )

So the easy solution here are:

 1. Export the data collected again and
    this time DO NOT TINKER with the
    data 
 2. In your Collect Earth export
    the data to XML and then just copy
    the contents from the first
    "corrupted"file into the folder "1"
    of this newly created ZIP file (you
    can basically just move the files
    from on file to the other )

So now you have a file that is following the structure that Collect Earth expects and that should work fine!!


  [1]: http://www.openforis.org/support/upfiles/2014-11-18_10-05-38.png
  [2]: http://www.openforis.org/support/upfiles/2014-11-18_10-07-40.png


## Answer (score 0, by collectearth on 2014-11-18)

Link: https://openforis.support/questions/108/error-on-importing-xml-or-csv-file/111

Hello Alessio,

This looks like a ZIP file corruption/error.

Can the ZIP file be open normally with WinRAR, WinZip or similar software?

Could there be a permission issue?

Was there any problem when you exported the data to XML ( ZIP file ) using Collect earth ?

/Collect Earth support


## Answer (score 0, by alessioalfonsetti on 2014-11-18)

Link: https://openforis.support/questions/108/error-on-importing-xml-or-csv-file/114

Hello there,

Thanks for the fast reply. Unfortunately the zip file is valid and the compression tools are able to work with it successful. As I said the issue also happens if we try to upload on by one (or a set of) the xml files originally compressed on to the zip file. No permission issues are detected on the log file and the import has been also tested with a faoadmin user on a FAO machine (just to make sure to have full capabilities on the file system).

Finally no problems detected on exporting.

Cheers,
Alessio
