Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
Community Advisor
Sep 11, 2018 12:35 PM UTC

Hi,

You are mixing osgi and Felix annotation.

Please use only osgi annotaions

remove org.apache.felix.scr.annotations.Reference and use import org.osgi.service.component.annotations.Reference;

Arun Patidar

14 replies

arunpatidar
Community Advisor
Community Advisor
Sep 11, 2018 12:00 PM UTC

Hi,

What are you trying to do,

you can get resource resolver from subservice user.

and then get appropriate objects value not null.

@Reference

  private ResourceResolverFactory resourceResolverFactory;

ResourceResolver resourceResolver = null;

  try {

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

    serviceParams.put(ResourceResolverFactory.SUBSERVICE, "training");

    resourceResolver = resourceResolverFactory.getServiceResourceResolver(serviceParams);

  } catch (LoginException e) {

  e.printStackTrace();

  }

Translate
Arun Patidar
熊先森Author
Sep 11, 2018 12:05 PM UTC


i

Translate
熊先森Author
Sep 11, 2018 12:16 PM UTC

i  don't know  because of  this  ”EventHandler“ 

all I received both of them are null

Translate
arunpatidar
Community Advisor
Community Advisor
Sep 11, 2018 12:17 PM UTC

Can you share your imports?

Translate
Arun Patidar
joerghoh
Adobe Employee
Adobe Employee
Sep 11, 2018 12:17 PM UTC

Have you used the Maven Archetype to boostrap your AEM project?

Jörg

Translate
熊先森Author
Sep 11, 2018 12:25 PM UTC

Translate
熊先森Author
Sep 11, 2018 12:28 PM UTC

yes  
because i use these Servlet can receive resolverFactory

Translate
arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
Sep 11, 2018 12:35 PM UTC

Hi,

You are mixing osgi and Felix annotation.

Please use only osgi annotaions

remove org.apache.felix.scr.annotations.Reference and use import org.osgi.service.component.annotations.Reference;

Translate
Arun Patidar
熊先森Author
Sep 11, 2018 12:36 PM UTC

i have to use this EventListener
but  i  need  listener many  pages publish
so i dont know  how to use this

Translate