springboot应用httpclient获取response报错

springboot应用A通过httpclient获得另一个springboot的httpresponse时报错:

WARN  ExceptionHandlerExceptionResolver:140 - Resolved [org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class org.apache.http.conn.EofSensorInputStream]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.apache.http.conn.EofSensorInputStream and no properties discovered to create BeanSerializer 
(to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)(through reference chain: org.apache.http.impl.execchain.HttpResponseProxy["entity"]->org.apache.http.impl.execchain.ResponseEntityProxy["content"])]

 

解决方案:

jackson:
  serialization:
    FAIL_ON_EMPTY_BEANS: false

yaml中增加配置

 

参考:

https://www.cnblogs.com/charlypage/p/9574452.html

你可能感兴趣的:(springboot)