-
Type: Bug
-
Status: Resolved
-
Priority: Critical
-
Resolution: Not A Bug
-
Affects Version/s: 9.10-SNAPSHOT
-
Fix Version/s: 9.10
-
Component/s: Scan importer
-
Backlog priority:700
-
Sprint:nxcore 9.10.2
-
Story Points:0
Environment : MacOS + Mongo + Redis
Step to reproduce:
- Follow https://www.nuxeo.com/blog/monday-dev-heaven-multithreaded-transactional-documents-import-nuxeo/ instructions
With this configuration, an error is raised on the date format :
2017-12-12 11:14:30,019 ERROR [Nuxeo-Importer-1] [org.nuxeo.ecm.platform.scanimporter.processor.ScanedFileSourceNode] Error during properties parsing java.io.IOException: java.text.ParseException: Unparseable date: at org.nuxeo.ecm.platform.scanimporter.service.ScannedFileMapperComponent.parseMetaData(ScannedFileMapperComponent.java:126) at org.nuxeo.ecm.platform.scanimporter.processor.ScanedFileSourceNode.getChildren(ScanedFileSourceNode.java:91) at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.recursiveCreateDocumentFromNode(GenericThreadedImportTask.java:327) at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.run(GenericThreadedImportTask.java:377) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.text.ParseException: Unparseable date: at org.apache.commons.lang3.time.FastDateParser.parse(FastDateParser.java:367) at org.apache.commons.lang3.time.FastDateFormat.parse(FastDateFormat.java:550) at org.nuxeo.ecm.platform.scanimporter.service.ScannedFileMapperComponent.parseMetaData(ScannedFileMapperComponent.java:124) ... 6 more
It happens because of this line in the extension :
<fieldMapping sourceXPath="//date[@name='order_date']" targetXPath="foo:order_date" targetType="date" dateFormat="yyyy-MM-dd"/>
As a result, the date metadata contained in XML file which should be imported is:
<date name="order_date" label="Order date" value="2005-03-17" />
So it really looks like the dateFormat is not correctly handled by the importer