Last updated on
17 May 2021
Symptoms
ValueFormatExceptions show up in the crx-quickstart/logs/error.log
file for author and/or publish:
2009.12.04 14:41:50.388 *INFO* [172.18.238.198 [1259966510248] GET /foo/bar.html HTTP/1.1] org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource setMetaData: Problem extracting metadata information for /content/apps/myapp/jcr:content/par/test_0 javax.jcr.ValueFormatException: conversion to long failed: For input string: "2009-08-24T14:02:57.793-07:00": For input string: "2009-08-24T14:02:57.793-07:00" at org.apache.jackrabbit.value.BaseValue.getLong(BaseValue.java:148) at org.apache.jackrabbit.core.PropertyImpl.getLong(PropertyImpl.java:486) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource.setMetaData(JcrNodeResource.java:230) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource.<init>(JcrNodeResource.java:70) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResourceIterator.seek(JcrNodeResourceIterator.java:91) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResourceIterator.next(JcrNodeResourceIterator.java:76) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResourceIterator.next(JcrNodeResourceIterator.java:38) at org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry$1.seek(ResourceProviderEntry.java:184) at org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry$1.next(ResourceProviderEntry.java:167) at org.apache.sling.jcr.resource.internal.helper.ResourceProviderEntry$1.next(ResourceProviderEntry.java:126) at com.day.cq.wcm.foundation.ParagraphSystem.collectParagraphs(ParagraphSystem.java:217) at com.day.cq.wcm.foundation.ParagraphSystem.initParas(ParagraphSystem.java:197) at com.day.cq.wcm.foundation.ParagraphSystem.paragraphs(ParagraphSystem.java:155) at org.apache.jsp.apps.pc_005fglobal.components.pcparsys.pcparsys_jsp._jspService(pcparsys_jsp.java:191) at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) ...
Resolution
- install CRX hotfix pack 1.4.2.5 or greater (request this hotfix via a daycare ticket)
- install CQ5.2.1 hotfix 24366 (request this hotfix via a daycare ticket)
- run the attached Date type cleanup script fix_date_props.zip
- To run the cleanup script script
- Install this package to your instance fix_date_props.zip
- Log into the instance as admin (Note for publish, to log in as admin you must go to
http://<host>:<port>/bin/login.html?resource=/
, after logging in then you have to change the URL in the address bar as it will not confirm that you are logged in). - run the script
http://<host>:<port>/etc/fixjcrlastmodified/fix.html
. It will list all of the paths containing jcr:lastModified and jcr:created properties that are String type and it will change them to Date type as it lists them. - After successfully running the script then you may safely delete the script from your server via CRX Content explorer. Log into CRX explorer and delete /etc/fixjcrlastmodified
Applies to
CQ 5.2.X
Download