我的 IDE 给了我该Unhandled Exception com.fasterxml.jackson.databind.JsonMappingException
行mapper.readValue
的错误
ObjectMapper mapper = new ObjectMapper();
try {
if (response.isEmpty()) {
//Http 204 (No Content) returned from MCC
//We should handle this differently
user = new User();
} else {
user = mapper.readValue(response, User.class);
}
} catch (IOException ioe) {
logger.log(Level.SEVERE, ioe.getLocalizedMessage());
}
return user;
我试过捕捉,JsonMappingException
但它并没有使错误消失。有什么想法吗?