EventConstants.EVENT_FILTER is not triggered under /conf | Community
Skip to main content
anelem1760873
Level 4
May 4, 2021
Solved

EventConstants.EVENT_FILTER is not triggered under /conf

  • May 4, 2021
  • 2 replies
  • 1012 views

Hi There,

Does anyone know why this is not triggered, i want to get the removed event under this node /conf.

@8220494( service = EventHandler.class, immediate = true, property = { EventConstants.EVENT_TOPIC + "=" + TestEventHandler.EVENT_TOPIC, EventConstants.EVENT_FILTER + "=(path=/conf/*)" } ) @Slf4j public class TestEventHandler implements EventHandler { public static final String EVENT_TOPIC = "org/apache/sling/api/resource/Resource/REMOVED"; ........

 -  

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 Ritesh_Mittal
 

Hi @anelem1760873 ,

 

Just check if the system user is having right permission which you must be using to get resolver. Like below-

 

Map<String, Object> params = new HashMap<>();
params.put(ResourceResolverFactory.SUBSERVICE, "myEventService");
resolver = resolverFactory.getServiceResourceResolver(params);

 

2 replies

Ritesh_Mittal
Community Advisor and Adobe Champion
Ritesh_MittalCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
May 4, 2021
 

Hi @anelem1760873 ,

 

Just check if the system user is having right permission which you must be using to get resolver. Like below-

 

Map<String, Object> params = new HashMap<>();
params.put(ResourceResolverFactory.SUBSERVICE, "myEventService");
resolver = resolverFactory.getServiceResourceResolver(params);

 

Prince_Shivhare
Community Advisor
Community Advisor
May 4, 2021

Alright! Agree with Ritesh. use a resource resolver using the service user and resource resolver factory.

A good article describes this - http://www.aemcq5tutorials.com/tutorials/create-system-user-in-aem/

 

make sure to give proper permission to the user.

 

Debug it and check if you are getting a resource resolver.