← Back to team overview

dhis2-devs team mailing list archive

[Bug 1235288] Re: Import Meta-Data JSON throws exception

 

Hi,

I get the error below when i try to import metadata from another DHIS2
instance in XML format using through the web-UI. I try using commandline
too but still get the same error.

Any idea on how to fix this or a workaround?

Thanks

 
ERROR 2014-08-28 09:18:40,473 (IOException) Unable to parse meta-data while reading input stream (ImportMetaDataTask.java [taskScheduler-1])
java.io.IOException: Stream closed
	at java.util.zip.ZipInputStream.ensureOpen(ZipInputStream.java:66)
	at java.util.zip.ZipInputStream.read(ZipInputStream.java:181)
	at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.ensureLoaded(ByteSourceJsonBootstrapper.java:503)
	at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.detectEncoding(ByteSourceJsonBootstrapper.java:129)
	at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.constructParser(ByteSourceJsonBootstrapper.java:224)
	at com.fasterxml.jackson.core.JsonFactory._createParser(JsonFactory.java:1242)
	at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:753)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2144)
	at org.hisp.dhis.dxf2.utils.JacksonUtils.fromJson(JacksonUtils.java:170)
	at org.hisp.dhis.importexport.action.util.ImportMetaDataTask.run(ImportMetaDataTask.java:84)
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1235288

Title:
  Import Meta-Data JSON throws exception

Status in DHIS 2:
  New

Bug description:
  When importing meta-data in JSON format the following exception is
  thrown:

  * INFO  2013-10-04 15:32:53,282 Export done at Fri Oct 04 15:32:53 BST 2013 (DefaultExportService.java [http-apr-8080-exec-9])
  * ERROR 2013-10-04 15:33:14,789 (IOException) Unable to parse meta-data while reading input stream (ImportMetaDataTask.java [taskScheduler-1])
  com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'tUpdated': was expecting 'null', 'true', 'false' or NaN
   at [Source: java.io.BufferedInputStream@754525d2; line: 1, column: 10]
          at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1284)
          at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:588)
          at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:2278)
          at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._matchToken(UTF8StreamJsonParser.java:2236)
          at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:587)
          at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:498)
          at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2618)
          at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2565)
          at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1856)
          at org.hisp.dhis.dxf2.utils.JacksonUtils.fromJson(JacksonUtils.java:160)
          at org.hisp.dhis.importexport.action.util.ImportMetaDataTask.run(ImportMetaDataTask.java:84)
          at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:724)

  
  Test:
  1. Export meta data in uncompressed JSON format.
  2. Import the MetaData.json file on the same instance.

  Replicable with different instances of dhis2. Tests made on dhis 2.13.

  Attatched is the json that provoced the above error.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1235288/+subscriptions


Follow ups

References