Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Resource Resolver is null, tried everything I could find!


Level 2

I have seen the same issue as I have listed numerous times in this forum and everything suggested I appear to have done.

Here is my simple class, all I am trying to do at this point is create an instance of a user manager and be done.

@Component(immediate = true, service = Servlet.class, property = { Constants.SERVICE_DESCRIPTION + "=User Sync",

"sling.servlet.methods=GET", "sling.servlet.paths=/services/userSync" })

public class UserSyncServlet extends SlingAllMethodsServlet {

private static final long serialVersionUID = 1L;

private static final Logger LOGGER = LoggerFactory.getLogger(UserSyncServlet.class);

private Session adminSession;


private ResourceResolverFactory resolverFactory;

protected void doGet(final SlingHttpServletRequest req, final SlingHttpServletResponse resp)

throws ServletException, IOException {


resp.getWriter().write("User Sync POC\n");

ResourceResolver resolver = null;

try {

Map<String, Object> authInfoParam = new HashMap<String, Object>();

authInfoParam.put(ResourceResolverFactory.SUBSERVICE, "dataservice");

resp.getWriter().write(authInfoParam + "\n");

if (resolverFactory != null) {

resolver = resolverFactory.getServiceResourceResolver(authInfoParam);

adminSession = resolver.adaptTo(Session.class);

final UserManager userManager = resolver.adaptTo(UserManager.class);

} else {

resp.getWriter().write("Resolver is null\n");


} catch (Exception e) {

resp.getWriter().write("Exception..." + e.getMessage() + "\n");

} finally {

if (adminSession != null && adminSession.isLive()) {



if (resolver != null)





When I run this I get this...

User Sync POC


Resolver is null

My bundle is named thusly...


My user mapper is set up like this


And datawrite is a SYSTEM user, created thru the JCR and also I checked it is a member of the admins group and, just to be double sure has all permissions checked in the useradmin tool.

What am I doing wrong?

If it helps, the only logs this seems to throw out to help me are on the sync.log

01.05.2019 13:00:02.938 *DEBUG* [qtp1919192112-69] Login: retrieving Credentials using callback.

01.05.2019 13:00:02.938 *DEBUG* [qtp1919192112-69] Login: No supported credentials obtained from callback; trying shared state.

01.05.2019 13:00:02.938 *DEBUG* [qtp1919192112-69] Login: No supported credentials found in shared state; looking for credentials in subject.

01.05.2019 13:00:02.938 *DEBUG* [qtp1919192112-69] No credentials found.

01.05.2019 13:00:02.938 *DEBUG* [qtp1919192112-69] Login: retrieving Credentials using callback.

01.05.2019 13:00:02.938 *DEBUG* [qtp1919192112-69] Login: No supported credentials obtained from callback; trying shared state.

01.05.2019 13:00:02.939 *DEBUG* [qtp1919192112-69] Login: No supported credentials found in shared state; looking for credentials in subject.

01.05.2019 13:00:02.939 *DEBUG* [qtp1919192112-69] No credentials found.

01.05.2019 13:00:02.962 *DEBUG* [qtp1919192112-69] Login: retrieving Credentials using callback.

01.05.2019 13:00:02.964 *DEBUG* [qtp1919192112-69] Login: Credentials '' obtained from callback

01.05.2019 13:00:02.969 *DEBUG* [0:0:0:0:0:0:0:1 [1556733602967] GET /services/userSync HTTP/1.1] No 'SupportedCredentials' configured. Using default implementation supporting 'SimpleCredentials'.

it does seem to indicate some creds are pulled back but it ends with No 'SupportedCredentials' configured.

so that seems to be my issue but going thru video demo's I seem to have set up everything correctly.

Please help.


1 Accepted Solution


Correct answer by
Level 10
9 Replies


Level 10

Did you open your bundle and look at the Symbolic name in the MF file?

Did you follow these instructions to create the System user?

To successfully query JCR data, create an Experience Manager System user by performing these tasks.

1. Open http://localhost:4502/crx/explorer/index.jsp.

2. Login as admin.

3. Click User Administration.

4. Click Create System User. Name the user data (data is used in this article).

5. Set the UserId.

6. Click Save

7.  Access the user page at http://localhost:4502/useradmin.

8.  Select the data user.

9. From the right-hand pane, select the Permissions tab.

10. Expand the content tab and then select the employees row.

11. Click all the checkboxes that represent the permissions (click the top row in permissions for this example).

12. Click the Save button located in the top menu bar (located above the Path heading). 


Level 2

Here is my manifest file, it should be the 'Bundle-SymbolicName: com.charter.panorama.bluesky.aem.AEMUserSync.core' right

which is does

Manifest-Version: 1.0

Bnd-LastModified: 1556729253514

Build-Jdk: 1.8.0_162

Built-By: JStarling

Bundle-Description: Core bundle for AEMUserSync

Bundle-ManifestVersion: 2

Bundle-Name: AEMUserSync - Core

Bundle-SymbolicName: com.charter.panorama.bluesky.aem.AEMUserSync.core

Bundle-Version: 1.0.0.SNAPSHOT

Created-By: Apache Maven Bundle Plugin



Import-Package: javax.jcr;version="[2.0,3)",javax.servlet,org.apache.j;version="[2.3,3)",;ve



Provide-Capability: osgi.service;objectClass:List<String>="javax.servl



Service-Component: OSGI-INF/


Tool: Bnd-

And as for system user, yes I did, permissions are all checked as well as being part of the admin group

and I verified the user thru crx/de is of type rep:SystemUser


Correct answer by
Level 10


Level 2

I can go thru it all again, can you tell me if the sync.log output I added is an indication of the error I am seeing or am I barking up the wrong tree on that one?


Level 10

I do not think that error is related. Try the article step by step. It does work - as you can see the video at the end.


Level 2

Well thank you kindly, my issue was basically my pom was screwed up.

crossing examples from adobe (older with newer) did not work out well

My issue was that I was NOT using

import org.osgi.service.component.annotations.Reference;

but the old

import org.apache.felix.scr.annotations.Reference;

When I switched this over I was having compiler issues

then I used your example to rework my pom file

and success!

Thank you so much


Level 10

I am very glad it worked for you. This the entire purpose of these working code examples.