Trying to add service user mapping in configuration, but not reflecting in aem console | Community
Skip to main content
Level 2
March 13, 2023
Solved

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

  • March 13, 2023
  • 4 replies
  • 992 views

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.
 
The file has below content, clearly did not accept the new configuration:
 
Whereas in the node it accepted the new one.
 
But the AEM console doesn't reflect the new configuration:

Any help regarding the issue would be appreciated.

 

Thanks,

Nandan

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 Jagadeesh_Prakash

@nandango1 

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 

4 replies

Jagadeesh_Prakash
Community Advisor
Jagadeesh_PrakashCommunity AdvisorAccepted solution
Community Advisor
March 13, 2023

@nandango1 

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 

aanchal-sikka
Community Advisor
Community Advisor
March 14, 2023

@nandango1 :

 

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.html#configuration-details

 

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

Aanchal Sikka
SivakumarKanoori
Community Advisor
Community Advisor
March 14, 2023

@nandango1 :

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
NandanGo1Author
Level 2
March 14, 2023

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.