I've been encountering this for a while now but I can't seem to find the reason why I'm getting this ambiguous error.
This is the error that I'm getting:
Sep 25 21:23:27 ip-172-31-29-87 web: java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path 'http://172.31.29.87/error': {public org.springframework.web.servlet.ModelAndView com.sample.controller.WebsiteController.error404() throws java.lang.Exception, public org.springframework.http.ResponseEntity org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)}
This is my http configuration:
.and().exceptionHandling().accessDeniedPage("/AccessDenied").
This is my /AccessDenied controller:
@RequestMapping(value = "/AccessDenied")
public ModelAndView accessDenied() throws Exception {
ModelAndView model = new ModelAndView("accessDenied");
return model;
}
Really hope you could help me. Thank you.