Exam AD0-E103 All QuestionsBrowse all questions from this exam
Question 69

A custom AEM application contains a service component that needs to access the JCR repository within the activate method. The activate method uses

ResourceResolverFactory.getServiceResourceResolver("¦) without specifying a sub service name.

What should a developer do to make sure the user service mapping for the service component is available?

    Correct Answer: A

    To ensure the user service mapping for the service component is available, create a field of type ServiceUserMapped and annotate it with @Reference. This will allow the component to get the necessary user mappings for accessing the JCR repository properly according to AEM conventions.

Discussion
chunpinOption: A

Answer: A Reference: https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/reference-materials/javadoc/org/apache/sling/serviceusermapping/ServiceUserMapped.html