EventListener AEM 6.5 Is not working
Hello, I am upgrading from AEM 6.4 to AEM 6.5, what happens is that the vanityPaths are not being generated automatically (in version 6.4 it worked without problems). I suspect it has to do with the class that implements EventListener
private Session session;
@3214626
private ResourceResolverFactory resourceResolverFactory;
private static final String SUBSERVICE = "readAccess";
@580286
public final void activate(ComponentContext context) throws RepositoryException {
log.debug("Activating PropertyAddedObservation");
String[] nodetypes = {"cq:PageContent"};
Map<String, Object> authInfo = Collections.singletonMap(ResourceResolverFactory.SUBSERVICE,
(Object) SUBSERVICE);
try (ResourceResolver administrativeResourceResolver = resourceResolverFactory.getServiceResourceResolver(authInfo)) {
session = administrativeResourceResolver.adaptTo(Session.class);
session.getWorkspace().getObservationManager().addEventListener(this, Event.PROPERTY_ADDED,
Constants.CONTINGENCYPATH, true, null, nodetypes, false);
} catch (RepositoryException e) {
throw new RepositoryException(e);
} catch (LoginException e) {
log.error("PropertyAddedObservation", e);
}
}
@3038739
public final void deactivate() {
if (session != null) {
session.logout();
}
}