Apache Sling Context-Aware Configuration | Community
Skip to main content
DhirajAg
Level 4
May 23, 2018 3:56 AM UTC
Solved

Apache Sling Context-Aware Configuration

Hi,

I am using the apache sling context-aware configuration in AEM 6.3 Service pack 2. I am trying to get the configuration resource using below method

@Reference

private ConfigurationResourceResolver configurationResourceResolver;

confResource = configurationResourceResolver.getResource(resource, BUCKET_NAME, CONFIG_NAME);

This works fine in author and in publish when I am logged in to publish as admin. However this gives a null when i try to run as anonymous. Any idea if there is any configuration I am missing.

My bundle versions are as below

org.apache.sling.caconfig.api

Version 1.1.0

org.apache.sling.caconfig.impl

Version

1.4.12

org.apache.sling.caconfig.spi

Version 1.3.2

Is there a service user configuration that I can try out? I tried to provide a system user for org.apache.sling.caconfig.impl  but even that didn't work out.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
DhirajAg
DhirajAgAccepted solution
Level 4
May 24, 2018 5:09 AM UTC

ConfMgr had the option to provide a serviceResourceResolver, but not with configurationResourceResolver. Giving read permissions to anonymous user for /conf directory solves the issue.

2 replies

smacdonald2008
Level 10
May 24, 2018 1:27 PM UTC

Nice answer!

Translate
DhirajAg
DhirajAgAuthorAccepted solution
Level 4
May 24, 2018 5:09 AM UTC

ConfMgr had the option to provide a serviceResourceResolver, but not with configurationResourceResolver. Giving read permissions to anonymous user for /conf directory solves the issue.

Translate