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
BedrockMission!

Learn More

View all

Sign in to view all badges

No services bound

Avatar

Avatar
Validate 1
Level 2
ashwiniv5325199
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
ashwiniv5325199
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ashwiniv5325199
Level 2

09-10-2018

HI TEAM,

      

           How to resolve the unsatisfied status to satisfied for Resource Resolver. Below is the screenshot of resource resolver service.In this I'm using OSGI annotation.

@Reference (org.osgi.service.component.annotations.Reference;)

protected ResourceResolver resourceResolver;(org.apache.sling.api.resource.ResourceResolver;)

1591949_pastedImage_0.png

Thanks & Regards,

Ashwini

Replies

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct Reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct Reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
PuzanovsP
MVP

09-10-2018

Dear Ashwini,

Resource Resolver can be retrieved from Resource Resolver Factory API[0], please change your implementation to

@Referece

ResourceResolverFactory factory; //, then you can use factory to retrieve ResourceResolver for your needs.

[0] ResourceResolverFactory (Apache Sling 7 API)

Regards,

Peter

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

09-10-2018

The proper code to obtain a ResourceResolver is:

@Component

public class EmployeeImpl implements EmployeeInter {

   

    /** Default log. */

    protected final Logger log = LoggerFactory.getLogger(this.getClass());

           

    private Session session;

               

    //Inject a Sling ResourceResolverFactory

    @Reference

    private ResourceResolverFactory resolverFactory;

   

   

    public String getEmployeeData()

    {

        Employee employee = null;

          

        List<Employee> employList = new ArrayList<Employee>();

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

        param.put(ResourceResolverFactory.SUBSERVICE, "datawrite");

        ResourceResolver resolver = null;

try {

                    

            //Invoke the adaptTo method to create a Session used to create a QueryManager

            resolver = resolverFactory.getServiceResourceResolver(param);

See - Adobe Experience Manager Help | Querying Adobe Experience Manager 6.4 JCR data

Avatar

Avatar
Validate 1
Level 2
ashwiniv5325199
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
ashwiniv5325199
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ashwiniv5325199
Level 2

09-10-2018

Thanks for the response

Avatar

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Feike_Visser1
Employee

09-10-2018

What AEM-version is this?

Avatar

Avatar
Validate 1
Level 2
ashwiniv5325199
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
ashwiniv5325199
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ashwiniv5325199
Level 2

09-10-2018

6.3 version