This is happening in AEM 6.5.2 . Due to this request combined with ACS Commons we noticed that The call that AEM is getting, that call in itself is 404 always, checked it on vanilla server. Since the call is 404, it would invoke your error handler JSP.. and the vanity check code is throwing some cod...