You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Robert Munteanu (Jira)" <ji...@apache.org> on 2021/01/07 13:50:00 UTC

[jira] [Commented] (SLING-10020) importing date property using sling post servlet fails

    [ https://issues.apache.org/jira/browse/SLING-10020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17260505#comment-17260505 ] 

Robert Munteanu commented on SLING-10020:
-----------------------------------------

[~jdas] - do I understand correctly that this is a regression for the JCR ContentLoader, and that the process worked with 2.2.4 but not anymore with 2.2.6?

> importing date property using sling post servlet fails
> ------------------------------------------------------
>
>                 Key: SLING-10020
>                 URL: https://issues.apache.org/jira/browse/SLING-10020
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: JCR ContentLoader 2.2.4, JCR ContentLoader 2.4.0, Servlets Post 2.3.26
>         Environment: AEM 6.5.6
>            Reporter: Johannes Das
>            Priority: Minor
>
> The issue happens when the import operation of the sling post servlet(2.3.26) is used:
> An imported data-structure contains a date like "2018-09-18T22:00:00.000+0000" results in a nullpointer beeing thrown without any clear logging.
> This happens because org.apache.sling.jcr.contentloader.internal.readers.JsonReader(2.2.6) accepts it as a date(line 280) and in org.apache.sling.jcr.contentloader.internal.DefaultContentCreator(2.2.6)  (line 309) it tries to parse the date-string into a calendar object which fails bacause it expects a string like "2018-09-18T22:00:00.000+00:00" or "2018-09-18T22:00:00.000Z".
> should there be a fallback like in version 2.2.4? This is still present in version 2.4.0.
> I also noticed org.apache.sling.jcr.contentloader.internal.readers.JsonReader(2.2.6) doesnt accept "2018-09-18T22:00:00.000Z"  as a date string. Should the regex in org.apache.sling.jcr.contentloader.internal.readers.JsonReader be adapted to also allow strings like "2018-09-18T22:00:00.000Z"? The regex is still the same in version 2.4.0.
> Should the logging be improved?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)