|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2016 the original author or authors. |
|
|
|
* Copyright 2002-2017 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -178,10 +178,20 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter { |
|
|
|
* @since 4.3 |
|
|
|
* @since 4.3 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected void logWarningIfNecessary(Type type, Throwable cause) { |
|
|
|
protected void logWarningIfNecessary(Type type, Throwable cause) { |
|
|
|
if (cause != null && !(cause instanceof JsonMappingException && cause.getMessage().startsWith("Can not find"))) { |
|
|
|
if (cause == null) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean debugLevel = (cause instanceof JsonMappingException && |
|
|
|
|
|
|
|
cause.getMessage().startsWith("Can not find")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (debugLevel ? logger.isDebugEnabled() : logger.isWarnEnabled()) { |
|
|
|
String msg = "Failed to evaluate Jackson " + (type instanceof JavaType ? "de" : "") + |
|
|
|
String msg = "Failed to evaluate Jackson " + (type instanceof JavaType ? "de" : "") + |
|
|
|
"serialization for type [" + type + "]"; |
|
|
|
"serialization for type [" + type + "]"; |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
if (debugLevel) { |
|
|
|
|
|
|
|
logger.debug(msg, cause); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (logger.isDebugEnabled()) { |
|
|
|
logger.warn(msg, cause); |
|
|
|
logger.warn(msg, cause); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
|