What is the best way to get the ResourceResolver in AEM6.1 | Community
Skip to main content
Dinu_Arya
New Participant
December 2, 2015
Solved

What is the best way to get the ResourceResolver in AEM6.1

  • December 2, 2015
  • 1 reply
  • 867 views

Hi Team,

What is the best way to get the ResourceResolver and Resource in AEM6.1? I followed this http://www.accunitysoft.com/resourceresolver-object-in-aem6-16-0-sling-services/ but I'm getting resource as null. I used "admin" instead of "testUser" user.

Thanks,

AryA.

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 smacdonald2008

IN AEM 6.1 -- you need an AEM system user -- see this community article: 

https://helpx.adobe.com/experience-manager/using/jqom.html

It shows you how to setup the system user and properly run this code:

Map<String, Object> param = new HashMap<String, Object>();
        param.put(ResourceResolverFactory.SUBSERVICE, "jqom");
        ResourceResolver resolver = null;
          
        try {
                     
            //Invoke the getServiceResourceResolver method to create a Session instance
            resolver = resolverFactory.getServiceResourceResolver(param);

1 reply

smacdonald2008
smacdonald2008Accepted solution
New Participant
December 2, 2015

IN AEM 6.1 -- you need an AEM system user -- see this community article: 

https://helpx.adobe.com/experience-manager/using/jqom.html

It shows you how to setup the system user and properly run this code:

Map<String, Object> param = new HashMap<String, Object>();
        param.put(ResourceResolverFactory.SUBSERVICE, "jqom");
        ResourceResolver resolver = null;
          
        try {
                     
            //Invoke the getServiceResourceResolver method to create a Session instance
            resolver = resolverFactory.getServiceResourceResolver(param);