How to create osgi config node for Factory services | Community
Skip to main content
Dinu_Arya
Level 6
Nov 17, 2017 3:07 PM UTC
Solved

How to create osgi config node for Factory services

Hi Team,

I have to set a system user (serviceuser) for my project so I tried to create osgi config node for org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl with the name org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-myproject

I have added the below properties -

service.ranking which is set to empty and later tried with 0 & 75000

user.mapping which is set to com.mycompany.myproject-bundle:writeService=serviceuser

I followed discussion there in https://forums.adobe.com/thread/2329678

I created org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl as well but in web console, I'm unable to see my configuration.

Is it mandatory to create org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl config node as well along with amended config?

I tried by creating the node names as -

org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended.config

org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended.config-myproject.

But still, my configuration is not available in OSGi configuration.

Can you please help me in this by providing any steps? Am I missing anything? I'm using AEM 6.2

Thanks,

AryA.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
VeenaVikraman
VeenaVikramanAccepted solution
New Participant
Nov 17, 2017 4:54 PM UTC

Hi Dinu

    I have faced the exact same situation recently. Let me guide you through what my observations are on this . For creating system user config for your project don't use the amended one , always use the org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl-<uniqueid>.

8 replies

Jul 30, 2018 3:35 PM UTC

For OSgi Config creation and reading it's values visit following link:

Creating and Reading OSGi Configuration Values for Adobe Experience Manager 6.3 – AEM Queries & Solutions

Translate
edubey
Level 10
Dec 29, 2017 7:23 AM UTC

AFAIK, org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl is not a factory configuration but it accepts mapping as multiple properties defined in array

But for factory configs like ACS Commons Named Image transformers, having a <unique> identifies holds true

Translate
VeenaVikraman
New Participant
Dec 28, 2017 9:43 PM UTC

I am having doubts on this one now. Because the other day when I installed this code to DEV server , the amended one picked up and not this one .. Can someone have a more clear understanding on how this works ?

edubey​ smacdonald2008​ Ratna Kumar​ ?

Translate
smacdonald2008
Level 10
Nov 17, 2017 7:09 PM UTC

Correct - we are working on this article for 6.3

Translate
Ratna_Kumar
Level 10
Nov 17, 2017 7:05 PM UTC

Hi Dinu,

We got it working on AEM 6.3. We have to update the dependencies in pom.xml file.

We will post the HELPX article on OSGI config values on AEM 6.3. See this thread for more updates!!

Thanks,

Ratna.

Translate
VeenaVikraman
VeenaVikramanAccepted solution
New Participant
Nov 17, 2017 4:54 PM UTC

Hi Dinu

    I have faced the exact same situation recently. Let me guide you through what my observations are on this . For creating system user config for your project don't use the amended one , always use the org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl-<uniqueid>.

Translate
Dinu_Arya
Dinu_AryaAuthor
Level 6
Nov 17, 2017 4:20 PM UTC

Hi Scott,

Whatever I have added in the osgi config node, they are not reflecting in web console.

Translate
smacdonald2008
Level 10
Nov 17, 2017 3:54 PM UTC

If you want to read values on Config nodes within an OSGi bundle - see this article that shows you this use case:

Scott's Digital Community: Reading AEM OSGi Configuration Values

See the Java logic in ConfigurationServiceImpl

Translate