Support for new JsonMappingException wording in Jackson 2.9

Issue: SPR-16947

(cherry picked from commit 6d0f8bf)
This commit is contained in:
Juergen Hoeller
2018-06-28 16:42:35 +02:00
parent a0f52bf633
commit 1b0d838a19
2 changed files with 6 additions and 3 deletions

View File

@@ -180,8 +180,9 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
return;
}
// Do not log warning for serializer not found (note: different message wording on Jackson 2.9)
boolean debugLevel = (cause instanceof JsonMappingException &&
cause.getMessage().startsWith("Can not find"));
(cause.getMessage().startsWith("Can not find") || cause.getMessage().startsWith("Cannot find")));
if (debugLevel ? logger.isDebugEnabled() : logger.isWarnEnabled()) {
String msg = "Failed to evaluate Jackson " + (type instanceof JavaType ? "de" : "") +