JCR event listener is not working in aem 6.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?
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?
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"); | |
| } |
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.