Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Repoinit configuration for Property set on AEM as cloud service

Avatar

Level 3

Hello,

I am trying to add property sling:configRef to a root page property through RepoInit Script in OSGI config. We are using AEM as cloud service and below is RepoInit script

 

RepoInit Script:

**********************************************************************

set properties on /content/myproject/us/jcr:content
    set sling:configRef{String} to /conf/myprojectconfi
end

**********************************************************************

 

But with this above code, getting below error:

28.01.2022 11:22:44.141 *INFO* [Apache Sling Repository Startup Thread #1] org.apache.sling.jcr.repoinit.impl.NodePropertiesVisitor Setting properties on nodePath '/content/myproject/us/jcr:content'
28.01.2022 11:22:44.141 *ERROR* [Apache Sling Repository Startup Thread #1] com.adobe.granite.repository.impl.SlingRepositoryManager Exception in a SlingRepositoryInitializer, SlingRepository service registration aborted
java.lang.RuntimeException: Unable to set properties on path [/content/myproject/us/jcr:content]:javax.jcr.PathNotFoundException: Node with path /content/myproject/us/jcr:content does not exist.
at org.apache.sling.jcr.repoinit.impl.DoNothingVisitor.report(DoNothingVisitor.java:63) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.jcr.repoinit.impl.NodePropertiesVisitor.visitSetProperties(NodePropertiesVisitor.java:217) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.repoinit.parser.operations.SetProperties.accept(SetProperties.java:44) [org.apache.sling.repoinit.parser:1.6.10]
at org.apache.sling.jcr.repoinit.impl.JcrRepoInitOpsProcessorImpl.apply(JcrRepoInitOpsProcessorImpl.java:56) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory.lambda$applyOperations$0(RepositoryInitializerFactory.java:151) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.jcr.repoinit.impl.RetryableOperation.apply(RetryableOperation.java:57) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory.applyOperations(RepositoryInitializerFactory.java:149) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory.processRepository(RepositoryInitializerFactory.java:129) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.jcr.base.AbstractSlingRepositoryManager.executeRepositoryInitializers(AbstractSlingRepositoryManager.java:627) [org.apache.sling.jcr.base:3.1.10]
at org.apache.sling.jcr.base.AbstractSlingRepositoryManager.initializeAndRegisterRepositoryService(AbstractSlingRepositoryManager.java:575) [org.apache.sling.jcr.base:3.1.10]
at org.apache.sling.jcr.base.AbstractSlingRepositoryManager.access$300(AbstractSlingRepositoryManager.java:96) [org.apache.sling.jcr.base:3.1.10]
at org.apache.sling.jcr.base.AbstractSlingRepositoryManager$4.run(AbstractSlingRepositoryManager.java:544) [org.apache.sling.jcr.base:3.1.10]
Caused by: javax.jcr.PathNotFoundException: Node with path /content/myproject/us/jcr:content does not exist.
at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNode(SessionImpl.java:341) [org.apache.jackrabbit.oak-jcr:1.40.0.T20220110121513-be5e04f]
at com.adobe.granite.repository.impl.CRX3SessionImpl.getNode(CRX3SessionImpl.java:185) [com.adobe.granite.repository:1.8.8]
at org.apache.sling.jcr.repoinit.impl.NodePropertiesVisitor.setNodeProperties(NodePropertiesVisitor.java:185) [org.apache.sling.jcr.repoinit:1.1.36]
at org.apache.sling.jcr.repoinit.impl.NodePropertiesVisitor.visitSetProperties(NodePropertiesVisitor.java:214) [org.apache.sling.jcr.repoinit:1.1.36]
... 10 common frames omitted

 

 

and there is way to create /content/myproject/jcr:content using script:

create path /content/myproject/jcr:content

 

Will this create jcr:content node on every deployment on AEM as CS environment ? 

 

 

1 Reply

Avatar

Level 1

Have you created as json.cfg file? Also, json.cfg does not support multi line script so please try to move it to single line and check.