Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Trying to add service user mapping in configuration, but not reflecting in aem console

Avatar

Level 3

Hi,

 

Tried adding a new mapper for service user in already existing file but it is not reflecting in console.

 

org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-torrid :

<?xml version="1.0" encoding="UTF-8"?>
    jcr:primaryType="sling:OsgiConfig"
    service.ranking="1"
    user.mapping="[com.torrid.aem.torrid-dynamicmedia.core:TorridService=torrid-service-user,com.torrid.aem.torrid-dynamicmedia.core:amplienceserviceuser=amplience-service-user]"/>
 
found the below shown node and a file in crx/de.
nandan123_1-1678727565788.png
 
The file has below content, clearly did not accept the new configuration:
nandan123_0-1678727519083.png
 
Whereas in the node it accepted the new one.
nandan123_2-1678727599311.png
 
But the AEM console doesn't reflect the new configuration:
nandan123_3-1678727626461.png

Any help regarding the issue would be appreciated.

 

Thanks,

Nandan

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@nandan123 

Can you please try doing in below sample example 

 

user.mapping=["xyz-aem.core:writeService\=content-writer-service","org.apache.sling.models.impl:writeService\=content-writer-service"]

 

file name: com.xyz.aem.core.workflows.SendEmailComplianceWorkflow.config 

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

@nandan123 

Can you please try doing in below sample example 

 

user.mapping=["xyz-aem.core:writeService\=content-writer-service","org.apache.sling.models.impl:writeService\=content-writer-service"]

 

file name: com.xyz.aem.core.workflows.SendEmailComplianceWorkflow.config 

Avatar

Community Advisor

@nandan123 :

 

Can you please try following?

- Delete the config from OSGi console.

- See if an updated configuration is visible now.

 

The OSGi configurations can be picked up from various locations in the repository. https://experienceleague.adobe.com/docs/experience-manager-65/deploying/configuring/configuring-osgi...

 

Maybe you have a similar config in some other path which is taking preference over the one you are expecting.


Aanchal Sikka

Avatar

Community Advisor

@nandan123 :

Osgi configurations will apply based on the run mode configurations, You can check if there is any run mode configurations available.

for example, 

if the configuration placed under the config.author with torrid-serviceuser  and  config.publish with amplience-serviceuser ,

 

in author it will be set to torrid-serviceuser and publisher it will set to amplience-serviceuser.

 

So check the run mode configurations as well once.

Thanks,
Siva

Avatar

Level 3

I created a file org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-torrid.config in my codebase with:

# Configuration created by Apache Sling JCR Installer
service.ranking=I"0"
user.mapping=["com.torrid.aem.torrid-dynamicmedia.core:TorridService\=torrid-service-user","com.torrid.aem.torrid-dynamicmedia.core:amplienceserviceuser\=amplience-service-user"]

Deployed this and the new configuration was reflecting on console.

 

Thank you everyone for your help.