Hi i have written a servelt (below)
In servelt i am getting all the children pages that are published but the url works fine in author mode but in publish mode i can't able to see any data
Looks like I am getting an empty array in publish mode Can someone help me with that?
The servelt returning empty array in publish but in author I am getting data
Here is my servelt code:
Views
Replies
Total Likes
Hi @tatrived
Can you please check your servlet is installed in the publish instances & in the active state? Also please check the result is cached or not. And also can you please check whether it is failing any where or not. You can check the logs. Also please ensure the access rights for the service users in the publish instance.
Check the service user permission in publisher
cq:lastReplicationAction property of a page. This property is protected and cannot be accessed by anonymous users.
Hi Suresh,
Thanks for the quick response
where can i find the publisher so that i can check user permission, sorry i am new to this
If you can help me navigate?
Hi @tatrived
Verify Permissions: Ensure that the user accessing the publish environment has the necessary permissions to read the child resources under the parent resource. Check the user's permissions in AEM and make sure they have read access to the required content.
Check Content Structure: Confirm that the content structure in the publish environment matches the structure in the author environment. Ensure that the parent resource and its child resources exist in the same location and have the same properties.
Debugging: Add logging statements to your servlet code to check if the parent resource and child resources are being retrieved correctly in the publish environment. You can log the values of parentResource and childResources.hasNext() to see if they are null or empty.
Resource Resolver: In some cases, the resource resolver used in the servlet may not have the necessary permissions to access the child resources in the publish environment. You can try using a different resource resolver or adapting the existing resource resolver to a system user or a user with appropriate permissions.
Replication Status: Ensure that the child resources are properly replicated to the publish environment. Check the replication status of the parent resource and its child resources to ensure they are replicated successfully.
Cache Clearing: If you have recently made changes to the content structure or permissions, try clearing the AEM cache in the publish environment. This can help ensure that the latest content and permissions are reflected.
Hi @tatrived
Please check the replication properties on publish by default it is not available on publish instances
Better to write debugger logs to debug and point the exact problem. Make sure you use log.debug but info.
Can you help me with how to check if page is published or not with any
Below line is the issue as it will not allow you to read node if we are not logged in to read resource and it'd data.
It will he good if you start your publish in debug mode and debug the issue.
ResourceResolver resourceResolver = request.getResourceResolver();
@tatrived Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies