I have a parent class with an @ExceptionHandler and a subclass with it's own version. I am getting an ambiguous method error

Viewed 5158

The parent:

@ExceptionHandler(NoUserException.class)
protected ModelAndView handleException(NoUserException e) {
    Map<String, Object> model = new HashMap<String, Object>();

    model.put(ModelKeys.HOST_KEY, "message");

    return new ModelAndView("noAccess",model);
}

The child:

@ExceptionHandler(NoUserException.class)
protected void handleException(NoUserException e, HttpServletRequest request, HttpServletResponse response) throws IOException {
    logger.error("Invalid user.");
    respond(CLIENT_USER_ERROR,response);
}

Yes, I do need them to have different parameters and outputs.

2 Answers
Related