Event Handler Path property is throwing null
Can you please to solve the null pointer exception in the handle event method.
Environment: AEMASCS
Below is the sample code which will execute when the content is published in this path(/content/dam).
paths is throwing the null pointer exception.
SlingConstants.PROPERTY_PATH = path
@Component(immediate = true, service = EventHandler.class, property = {
Constants.SERVICE_DESCRIPTION + "= This event handler listens the events on page activation",
EventConstants.EVENT_TOPIC + "=org/apache/sling/distribution/agent/package/distributed",
EventConstants.EVENT_FILTER + "=(&(distribution.paths=/content/dam/*) (|(distribution.type=ADD)(distribution.type=DELETE)))",
})
public class TestHandler implements EventHandler {
public void handleEvent(Event event) {
log.info("Testing on DEV...");
String[] paths = (String[]) event.getProperty(SlingConstants.PROPERTY_PATH);
}
Please help me.
