Getting javax.jcr.PathNotFoundException , when trying to give ACL for a particular path. | Community
Skip to main content
July 10, 2023
Solved

Getting javax.jcr.PathNotFoundException , when trying to give ACL for a particular path.

  • July 10, 2023
  • 1 reply
  • 2110 views

Hi All,

I have created a custom search facet from the search forms, after creating this a node structure became visible at the path "/conf/global/settings/dam/search".

 

Now , I am trying to set ACL's for the path - "/conf/global/settings/dam/search" via repoinit , the build get succussed in local , but when we try to deploy the code on AEM as a cloud service it throws the following exception and build gets failed.

 

javax.jcr.RepositoryException: Applying repoinit operation failed despite retry; set loglevel to DEBUG to see all exceptions. Last exception message was: Failed to set ACL (javax.jcr.PathNotFoundException: Cannot set ACL on non-existent path /conf/global/settings/dam/search) AclLine ALLOW {paths=[/conf/global/settings/dam/search], privileges=[jcr:read]}_    at org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory.applyOperations(RepositoryInitializerFactory.java:154)_    at org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory.processRepository(RepositoryInitializerFactory.java:130)_    at org.apache.sling.jcr.base.AbstractSlingRepositoryManager.executeRepositoryInitializers(AbstractSlingRepositoryManager.java:627)_ 

 

 

Any help or leads will be appreciated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

hello @jhhjhjkuku 

 

If you have created the search facet locally and deploying it via code, the path may be exist on the server. Please check by visiting via CRXDE or repository browser.

 

To set ACL via repoinit, we first need to assure that the path exists. To achieve the same create the node structure with proper jcr:primaryType in the repo-init and then setup ACLs.

 

{ "scripts": [ "create path (sling:OrderedFolder) /content/dam/abc", "set ACL on /content/dam/abc\r\n allow jcr:read for abc-grp\r\nend", ] }

1 reply

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
July 10, 2023

hello @jhhjhjkuku 

 

If you have created the search facet locally and deploying it via code, the path may be exist on the server. Please check by visiting via CRXDE or repository browser.

 

To set ACL via repoinit, we first need to assure that the path exists. To achieve the same create the node structure with proper jcr:primaryType in the repo-init and then setup ACLs.

 

{ "scripts": [ "create path (sling:OrderedFolder) /content/dam/abc", "set ACL on /content/dam/abc\r\n allow jcr:read for abc-grp\r\nend", ] }
Aanchal Sikka