Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

JCR event listener is not working in aem 6.4

Avatar

Level 4

Hi all,

Looks like the JCR event listener in 6.4 is broken. Events dont get triggered at all. Is anyone else facing the same issue? Is there any solution?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Scott,

It does work with system user as well. But you need JCR repository session in order to get jcr events work.

Below code works for me.

aem63app-repo/SampleJCREvent.java at master · arunpatidar02/aem63app-repo · GitHub

@Reference
private SlingRepository repository;
private Session session;
private ObservationManager observationManager;
protected void activate(ComponentContext context) throws Exception {
session = repository.loginService("readService",null);
observationManager = session.getWorkspace().getObservationManager();
observationManager.addEventListener(this, Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED, "/content/AEM64App/fr", true, null,
new String[]{"cq:PageContent","nt:unstructured"} , true);
logger.info("*************added JCR event listener");
}
Arun Patidar

AEM LinksLinkedIn

View solution in original post

22 Replies

Avatar

Community Advisor

Then it should work

Do you have service user and other user mapping configuration for below

 

session = repository.loginService("readService",null); 

 

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 4

@arunpatidar, Yes, I have. but event is not triggering. is there anything i need to verify?