Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

LiveRelationshipManager error: No content resource for resource at path "/content/..."

Avatar

Level 2

Hi all.

Recently Im facing an issue when I try to retrieve all liveCopyRelationships related to a page:

 

LiveRelationshipManager liveRelationshipManager = resourceResolver.adaptTo(LiveRelationshipManager.class);

RangeIterator liveRelationships = liveRelationshipManager.getLiveRelationships(myPageResource, null, null);

 

These instructions retrieve me all liveCopyRelationships but recently it does not work anymore ONLY on publish envs.

The issue is raised when i loop my RangeIterator as follow:

LiveRelationship liveCopy = (LiveRelationship) liveRelationships.next();

 

For certain page contents i get this error:

 

java.lang.RuntimeException: com.day.cq.wcm.api.WCMException: javax.jcr.ItemNotFoundException: No content resource for resource at path /content/myContentPage
at com.day.cq.wcm.msm.impl.LiveRelationshipManagerImpl$LiveRelationshipIterator.next(LiveRelationshipManagerImpl.java:1152) [com.day.cq.wcm.cq-msm-core:5.13.60]

[...]
Caused by: com.day.cq.wcm.api.WCMException: javax.jcr.ItemNotFoundException: No content resource for resource at path /content/myContentPage
at com.day.cq.wcm.msm.impl.LiveRelationshipManagerImpl.buildRelationship(LiveRelationshipManagerImpl.java:869) [com.day.cq.wcm.cq-msm-core:5.13.60]
at com.day.cq.wcm.msm.impl.LiveRelationshipManagerImpl.access$100(LiveRelationshipManagerImpl.java:81) [com.day.cq.wcm.cq-msm-core:5.13.60]
at com.day.cq.wcm.msm.impl.LiveRelationshipManagerImpl$LiveRelationshipIterator.seek(LiveRelationshipManagerImpl.java:1107) [com.day.cq.wcm.cq-msm-core:5.13.60]
at com.day.cq.wcm.msm.impl.LiveRelationshipManagerImpl$LiveRelationshipIterator.next(LiveRelationshipManagerImpl.java:1150) [com.day.cq.wcm.cq-msm-core:5.13.60]
... 24 common frames omitted
Caused by: javax.jcr.ItemNotFoundException: No content resource for resource at path /content/myContentPage
at com.day.cq.wcm.msm.impl.Utils.getContentResource(Utils.java:214) [com.day.cq.wcm.cq-msm-core:5.13.60]
at com.day.cq.wcm.msm.impl.StatusUtil.createLiveStatus(StatusUtil.java:57) [com.day.cq.wcm.cq-msm-core:5.13.60]
at com.day.cq.wcm.msm.impl.LiveRelationshipManagerImpl.buildRelationship(LiveRelationshipManagerImpl.java:856) [com.day.cq.wcm.cq-msm-core:5.13.60]
... 27 common frames omitted

 

I cannot skip this error because raised exception is a runtimeException so i'd prefer to understand why this exception occurred rather than catch it with a generic Exception.

I really cannot understand in which scenario this could happen. Do you think that some content has been deleted on publish server? How could the liveCopyRelationship have been broken?

 

Can someone help me to understand why often this issue appears?

Thanks in advance.

 

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @Stochino!

While I haven't faced this exact exception yet, I would recommend the following to analyze the issue further:

 

You're saying that the issue only occurs on your publish instances.
I'm a bit curious about why you would need to know about LiveCopy relationships on the publish tier, but that's a different question. I'm not even sure if all required LiveCopy information (e. g. properties and mixins) are replicated on publication. This would be a first step to do: compare the content between author and publish instance on a repository level and see if there are differences for the concerned pages.

Another topic that is common to be involved for differences between author and publish tier is user sessions and permissions: while on the author instance every user needs to log in before accessing the system (thus has a session and certain permissions according to his group memberships) on the publish side visitors often don't have to login and are assigned the "anonymous" role with very limited permissions. In this context it would be interesting to know what resourceResolver your code uses. Where does it come from? Does it have the necessary permissions (on the publish side) to access the concerned content?

If you are using a service user or your user (the one for the resourceResolver) has certain group membership, have you verified that the user(s) and the groups are replicated to the publish side as well?

 

Hope that helps for further analysis!

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi @Stochino!

While I haven't faced this exact exception yet, I would recommend the following to analyze the issue further:

 

You're saying that the issue only occurs on your publish instances.
I'm a bit curious about why you would need to know about LiveCopy relationships on the publish tier, but that's a different question. I'm not even sure if all required LiveCopy information (e. g. properties and mixins) are replicated on publication. This would be a first step to do: compare the content between author and publish instance on a repository level and see if there are differences for the concerned pages.

Another topic that is common to be involved for differences between author and publish tier is user sessions and permissions: while on the author instance every user needs to log in before accessing the system (thus has a session and certain permissions according to his group memberships) on the publish side visitors often don't have to login and are assigned the "anonymous" role with very limited permissions. In this context it would be interesting to know what resourceResolver your code uses. Where does it come from? Does it have the necessary permissions (on the publish side) to access the concerned content?

If you are using a service user or your user (the one for the resourceResolver) has certain group membership, have you verified that the user(s) and the groups are replicated to the publish side as well?

 

Hope that helps for further analysis!

Avatar

Community Advisor

Hi @Stochino

Can you check if the page/path where the exception is thrown has jcr:content node. (Check if it is missing/removed accidently)

Example : path mentioned as part of exception, javax.jcr.ItemNotFoundException: No content resource for resource at path /content/myContentPage