@ExceptionHandler(HttpMessageNotReadableException.class)@ResponseBodypublic ResultResponse handleException(HttpMessageNotReadableException ex, WebRequest request){
logger.info(ex.getMessage());
Throwable t = ex.getCause();
if (t != null && t instanceof InvalidFormatException) {
InvalidFormatException ife = (InvalidFormatException) t;
for (Reference r : ife.getPath()) {
logger.info(r.getFieldName());
}
logger.info("type= " + ife.getTargetType().getName());
logger.info("value=" + ife.getValue());
}
returnnew ResultResponse();
}
아래와 같은 오류가 출력되었다.
could not read json can not instantiate value of type … abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information