又是跨服务问题!!返回值类的问题

问题:

Error while extracting response for type [java.util.List] and content type [application/json]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `java.util.ArrayList` from Object value (token `JsonToken.START_OBJECT`); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.util.ArrayList` from Object value (token `JsonToken.START_OBJECT`)\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 1]

 错误的原因:

跨服务的接口返回值类型错误。

具体的就是微服务A中调用微服务B中的接口时,一定要保证微服务A的返回值类型和微服务B的返回值类型一致才可以呀。

比如:微服务A返回值类型就是一个实体类,那么微服务B中调用时返回值就不能是一个List封装的实体类。

 

你可能感兴趣的:(微服务)