If you do not want to use a custom objectMapper or do not want to use String as the input to a method, you can use spring ExceptionHandler . Just add the following method to your controller, and then you will see jackson database errors in the console.
@ExceptionHandler(HttpMessageNotReadableException.class) @ResponseStatus(value=HttpStatus.BAD_REQUEST, reason="There was an error processing the request body.") public void handleMessageNotReadableException(HttpServletRequest request, HttpMessageNotReadableException exception) { System.out.println("\nUnable to bind post data sent to: " + request.getRequestURI() + "\nCaught Exception:\n" + exception.getMessage()); }
spring documentation: Exception handling in spring MVC
If you want to ignore some of Jackson's useless exceptions, you can use your own Jackson ObjectMapper in springframework. just see this answer .
source share