Component throws 'jcr:lastModified' can't be put into node error | Community
Skip to main content
June 7, 2023

Component throws 'jcr:lastModified' can't be put into node error

  • June 7, 2023
  • 4 replies
  • 2813 views

Hi everyone. 
Would like to ask how to fix this one. I have a component developed. Then at some point I can't add it anymore to the template and it just shows


and the error shows

07.06.2023 15:17:32.313 *WARN* [[0:0:0:0:0:0:0:1] [1686122252303] POST /content/acom/language-masters/***********/jcr:content/root/container_main/ HTTP/1.1] org.apache.sling.servlets.post.impl.SlingPostServlet Exception while handling POST on path [/content/acom/language-masters/*************************/jcr:content/root/container_main] with operation [org.apache.sling.servlets.post.impl.operations.ModifyOperation]
java.lang.IllegalArgumentException: Value 'java.util.GregorianCalendar[time=1686122252311,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=31,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2023,MONTH=5,WEEK_OF_YEAR=23,WEEK_OF_MONTH=2,DAY_OF_MONTH=7,DAY_OF_YEAR=158,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=3,HOUR_OF_DAY=15,MINUTE=17,SECOND=32,MILLISECOND=311,ZONE_OFFSET=28800000,DST_OFFSET=0]' for property 'jcr:lastModified' can't be put into node '/content/acom/language-masters/**************************/jcr:content/root/container_main/{component}'.

And the following thread:
Caused by: javax.jcr.nodetype.ConstraintViolationException: No matching property definition: jcr:lastModified = 2023-06-07T15:17:32.311+08:00
    at org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate.setProperty(NodeDelegate.java:514) [org.apache.jackrabbit.oak-jcr:1.42.0.T20220705075745-7aee0b1]
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl$36.perform(NodeImpl.java:1404) [org.apache.jackrabbit.oak-jcr:1.42.0.T20220705075745-7aee0b1]
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl$36.perform(NodeImpl.java:1391) [org.apache.jackrabbit.oak-jcr:1.42.0.T20220705075745-7aee0b1]
    at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:210) [org.apache.jackrabbit.oak-jcr:1.42.0.T20220705075745-7aee0b1]
    at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:112) [org.apache.jackrabbit.oak-jcr:1.42.0.T20220705075745-7aee0b1]
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl.internalSetProperty(NodeImpl.java:1391) [org.apache.jackrabbit.oak-jcr:1.42.0.T20220705075745-7aee0b1]
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl.setProperty(NodeImpl.java:368) [org.apache.jackrabbit.oak-jcr:1.42.0.T20220705075745-7aee0b1]
    at org.apache.sling.jcr.resource.internal.JcrModifiableValueMap.put(JcrModifiableValueMap.java:73) [org.apache.sling.jcr.resource:3.2.0]
    ... 170 common frames omitted
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

June 7, 2023

Are you facing this on your local AEM instance?

Can you try removing the jcr:lastModified node from the crx manually.

June 7, 2023

Ah, yup. Only on the local.

On which node should I remove the jcr:lastModified?

 

June 7, 2023

Are you trying to add/modify the jcr:lastModified via component code ?

Ideally dont do that.

 

Also, create a new page and try adding the component to the page, that will rule out of the issue is with the component or a one of issue with the page/template itself.

Sady_Rifat
Community Advisor
Community Advisor
June 7, 2023

Hello @lyonmartin ,
Based on your discussion with @parakhma I am guessing the problem is in your newly created component. Since on the page, you can add other components except for the new one.
But it's really difficult to say why this problem occurred without seeing the code.
Still, you can recheck your component properties or create a demo project and try to see what behaves there.

aanchal-sikka
Community Advisor
Community Advisor
June 7, 2023

Hello @lyonmartin 

 

The logs refer to path as "/content/acom/language-masters/**************************/jcr:content/root/container_main/{component}"

 

Apologies, it may be my lack of understanding, but what is {component}. This node name seems weird.

 

Is the component creating any default structure or adding default properties?

Aanchal Sikka
June 7, 2023

oh, it's just a placeholder for my component. I just didn't named it as maybe I'll be in trouble legally 😄

Basically, it is a component with a carousel as supertype.

aanchal-sikka
Community Advisor
Community Advisor
June 7, 2023

Thanks for the clarification @lyonmartin 

 

Second part of the question still remains: Is the component creating any default structure or adding default properties?

 
Aanchal Sikka
rk_pandian
December 11, 2023

Hi @lyonmartin,

 

I had a similar issue in my local and then I found out that it was caused due to an empty folder in my component structure. I had an empty _cq_template folder (wanted to add a file later) but once I removed that folder, I was able to use my component as intended.

 

So please check if you have any empty files or folders which might cause this issue.

 

Regards,

Ramkumar