Getting cannot derive user name for bundle and sub service while creating resource resolver

Avatar

Avatar
Validate 10
Level 1
pillaivinit
Level 1

Likes

0 likes

Total Posts

30 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 10
Level 1
pillaivinit
Level 1

Likes

0 likes

Total Posts

30 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Applaud 5
Affirm 1
View profile
pillaivinit
Level 1

25-11-2020

Hi.

I'm using AEM 6.3

I have followed this correctly I think. and also followed Ensure authhorizable


I don't know if only one is required or both are required. I'm new at this.

 

Map<String, Object> params = new HashMap<>();
params.put(ResourceResolverFactory.SUBSERVICE, SERVICE);
ResourceResolver resourceResolver = resourceResolverFactory.getServiceResourceResolver(params)

 The above line is where I get the error. Have I missed something?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

140 likes

Total Posts

188 posts

Correct reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

140 likes

Total Posts

188 posts

Correct reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile
Manjunath_K
MVP

27-11-2020

Hi @pillaivinit ,

Please cross check below points once.

 

1. Bundle symbolic name (project.core) defined in ServiceUserMapperImpl config xml is same as defined in core pom.xml 

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" user.mapping="[project.core:ServiceUser=ServiceUser]"/>

 

core pom.xml:

<Bundle-SymbolicName>project.core</Bundle-SymbolicName>

 

2. Access user admin (http://localhost:4502/useradmin ) & check whether service user created by EnsureServiceUser config xml

 

3. same subServiceName is used in backend java as defined in  ServiceUserMapperImpl config xml.

user.mapping="[project.core:ServiceUser=ServiceUser]

 

params.put(ResourceResolverFactory.SUBSERVICE, "ServiceUser");

 

Hope this helps!

Answers (3)

Answers (3)

Avatar

Avatar
Affirm 100
MVP
shelly-goel
MVP

Likes

246 likes

Total Posts

410 posts

Correct reply

105 solutions
Top badges earned
Affirm 100
Give Back 25
Ignite 3
Give Back 10
Validate 1
View profile

Avatar
Affirm 100
MVP
shelly-goel
MVP

Likes

246 likes

Total Posts

410 posts

Correct reply

105 solutions
Top badges earned
Affirm 100
Give Back 25
Ignite 3
Give Back 10
Validate 1
View profile
shelly-goel
MVP

28-11-2020

@pillaivinit  Since you're on AEM6.3, migrating to Sling RepoInit would be better to ensure authorizables https://sling.apache.org/documentation/bundles/repository-initialization.html

 

Avatar

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct reply

58 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct reply

58 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ankur_Khare
MVP

27-11-2020

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,314 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,314 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

25-11-2020

Can you share the Apache sling Service User Mapper Service Amendmentmapping.

Make sure the system user is available and your code have the SERVICE name same as mapping

 

Please http://www.sgaemsolutions.com/2017/10/sling-service-authentication-in-aem-63.html