Getting Ambiguous @ExceptionHandler method mapped for MethodArgumentNotValidException while startup of spring boot application
The ambiguity is because you have the same method – @ExceptionHandler in both the classes – ResponseEntityExceptionHandler, MethodArgumentNotValidException. You need to write the overridden method as follows to get around this issue – @Override protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { String errorMessage = ex.getBindingResult().getFieldErrors().get(0).getDefaultMessage(); List<String> validationList = ex.getBindingResult().getFieldErrors().stream().map(fieldError->fieldError.getDefaultMessage()).collect(Collectors.toList()); LOGGER.info(“Validation error … Read more