6

We have a Tridion implementation with UGC. From the CD side, we can correclty add comments and let users modify their comment.

However, when we want to manage any comment from the CME (in the comments tab of a page), we get the error message "Failed to saving comment".

When checking the debug log on the moderation webservice, we see this json is posted to the service, and we see this error

2015-11-13 14:51:24,453 DEBUG WritableCommentEntryService - Parsing comment: {d:{"Id":2,"ItemPublicationId":2066,"ItemId":17978,"ItemType":64,"CreationDate":"\/Date(1446786426000)\/","LastModifiedDate":"\/Date(-62135596800000)\/","User":{"Id":"WIN-SQC3BSLTNDP%5Ccb","Name":"xxxx","EmailAddress":"null","ExternalId":"null"},"Content":"Test Comment 2gh","Moderator":"WIN-SQC3BSLTNDP%5Ccb","ModeratedDate":"\/Date(1447426277213)\/","Score":0,"Status":2}}.
2015-11-13 14:51:24,469 ERROR WritableCommentEntryService - Could not parse the comment to update to storage: {d:{"Id":2,"ItemPublicationId":2066,"ItemId":17978,"ItemType":64,"CreationDate":"\/Date(1446786426000)\/","LastModifiedDate":"\/Date(-62135596800000)\/","User":{"Id":"WIN-SQC3BSLTNDP%5Ccb","Name":"xxxx","EmailAddress":"null","ExternalId":"null"},"Content":"Test Comment 2gh","Moderator":"WIN-SQC3BSLTNDP%5Ccb","ModeratedDate":"\/Date(1447426277213)\/","Score":0,"Status":2}}
java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(Unknown Source) ~[na:1.8.0_45]
    at java.lang.Long.parseLong(Unknown Source) ~[na:1.8.0_45]
    at java.lang.Long.parseLong(Unknown Source) ~[na:1.8.0_45]
    at com.tridion.ugc.odata.mappers.ItemPopulator.parseJSONDate(ItemPopulator.java:66) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.mappers.ItemPopulator.populate(ItemPopulator.java:48) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.mappers.CommentMapper.mapComment(CommentMapper.java:60) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.mappers.CommentMapper.mapComment(CommentMapper.java:27) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableCommentEntryService.parseEntity(WritableCommentEntryService.java:42) [ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableCommentEntryService.parseEntity(WritableCommentEntryService.java:26) [ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableBaseEntryService.parseInputData(WritableBaseEntryService.java:126) [ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableBaseEntryService.update(WritableBaseEntryService.java:81) [ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableCommentEntryService.update(WritableCommentEntryService.java:26) [ugc_webservice.jar:na]
    at com.tridion.webservices.odata.input.handler.ODataWebserviceHandler.updateODataEntity(ODataWebserviceHandler.java:419) [cd_odata.jar:na]
2015-11-13 14:51:24,470 ERROR ODataWebserviceHandler - Storage exception while updating an entity.
com.tridion.webservices.odata.exceptions.ODataStorageException: Could not parse the comment to update to storage: {d:{"Id":2,"ItemPublicationId":2066,"ItemId":17978,"ItemType":64,"CreationDate":"\/Date(1446786426000)\/","LastModifiedDate":"\/Date(-62135596800000)\/","User":{"Id":"WIN-SQC3BSLTNDP%5Ccb","Name":"xxxx","EmailAddress":"null","ExternalId":"null"},"Content":"Test Comment 2gh","Moderator":"WIN-SQC3BSLTNDP%5Ccb","ModeratedDate":"\/Date(1447426277213)\/","Score":0,"Status":2}}
    at com.tridion.ugc.odata.services.WritableCommentEntryService.parseEntity(WritableCommentEntryService.java:45) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableCommentEntryService.parseEntity(WritableCommentEntryService.java:26) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableBaseEntryService.parseInputData(WritableBaseEntryService.java:126) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableBaseEntryService.update(WritableBaseEntryService.java:81) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableCommentEntryService.update(WritableCommentEntryService.java:26) ~[ugc_webservice.jar:na]
    at com.tridion.webservices.odata.input.handler.ODataWebserviceHandler.updateODataEntity(ODataWebserviceHandler.java:419) ~[cd_odata.jar:na]
Caused by: java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(Unknown Source) ~[na:1.8.0_45]
    at java.lang.Long.parseLong(Unknown Source) ~[na:1.8.0_45]
    at java.lang.Long.parseLong(Unknown Source) ~[na:1.8.0_45]
    at com.tridion.ugc.odata.mappers.ItemPopulator.parseJSONDate(ItemPopulator.java:66) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.mappers.ItemPopulator.populate(ItemPopulator.java:48) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.mappers.CommentMapper.mapComment(CommentMapper.java:60) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.mappers.CommentMapper.mapComment(CommentMapper.java:27) ~[ugc_webservice.jar:na]
    at com.tridion.ugc.odata.services.WritableCommentEntryService.parseEntity(WritableCommentEntryService.java:42) ~[ugc_webservice.jar:na]
    ... 5 common frames omitted

The problem appears to be the parsing of the date

 "LastModifiedDate":"\/Date(-62135596800000)\/"

Is this a known issue, or is there a configuration setting we need to get this fixed ?

6

Both dates are way out of range for Unix dates. 1446786426000 = Sat, 02 Nov 47816 06:20:00 GMT; and -62135596800000 = Invalid Date

Have a look at where they were generated or how they were formatted. If you drop the "000" from the end of both dates then they become valid: 1446786426 = Fri, 06 Nov 2015 05:07:06 GMT and -62135596800 = Mon, 01 Jan 1 00:00:00 GMT

  • Unfortunately, those dates are not generated by our code, but by the Tridion UGC dll's. – Harald Hoffelinck Nov 14 '15 at 10:44
1

We have contacted SDL support for this, and they provided a hotfix. Once the hotfix (a dll that needs to be replaced on the CM server) is applied, editing works fine.

1

For future reference, the hotfix mentioned is UGC_2013.1.0.88319, applicable to 2013 SP1.

1

I am unable to find UGC_2013.1.0.88319 hotfix in SDL Tridion World. I am also getting the same issue, but can anyone point me to right direction where to get the correct dll that needs to replaced.

Note - I am using SDL Tridion 2013 SP1.

  • 1
    Contact customer support and ask for the fix. – Nuno Linhares Sep 1 '16 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.