request.getSession().setAttribute(ACEGI_SECURITY_LAST_EXCEPTION_KEY, failed);
try { request.getSession().setAttribute(ACEGI_SECURITY_LAST_EXCEPTION_KEY, failed); } catch (Exception ignored) {}
    protected void unsuccessfulAuthentication(HttpServletRequest request,        HttpServletResponse response, AuthenticationException failed)        throws IOException {        SecurityContextHolder.getContext().setAuthentication(null);        if (logger.isDebugEnabled()) {            logger.debug(                "Updated SecurityContextHolder to contain null Authentication");        }        String failureUrl = exceptionMappings.getProperty(failed.getClass()                                                                .getName(),                authenticationFailureUrl);        if (logger.isDebugEnabled()) {            logger.debug("Authentication request failed: " + failed.toString());        }        request.getSession().setAttribute(ACEGI_SECURITY_LAST_EXCEPTION_KEY,            failed);        onUnsuccessfulAuthentication(request, response);        rememberMeServices.loginFail(request, response);        response.sendRedirect(response.encodeRedirectURL(request.getContextPath()                + failureUrl));    }