JDK:1.8
retrofit-spring-boot-starter版本:2.2.7
异常效果:
依然走默认JacksonConverterFactory解析,不走JaxbConverterFactory解析返回数据。
@RetrofitClient(baseUrl = "http://xxx.com",converterFactories = {JaxbConverterFactory.class}) @QooJpSign(exclude = {"/GMKT.INC.Front.QAPIService/CertificationAPI.CreateCertificationKey"}) @Retry public interface QooJpXmlApi
如上注解已经配置JaxbConverterFactory,但是系统依然走默认配置JacksonConverterFactory
异常如下:
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 2] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1851) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:707) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:632) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1947) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:776) at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:357) at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2064) at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1485) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:33) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23) at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243) at retrofit2.OkHttpCall.execute(OkHttpCall.java:204) at com.github.lianjiatech.retrofit.spring.boot.core.BodyCallAdapterFactory$BodyCallAdapter.adapt(BodyCallAdapterFactory.java:77) ... 104 more
JDK:1.8 retrofit-spring-boot-starter版本:2.2.7 异常效果: 依然走默认JacksonConverterFactory解析,不走JaxbConverterFactory解析返回数据。
@RetrofitClient(baseUrl = "http://xxx.com",converterFactories = {JaxbConverterFactory.class}) @QooJpSign(exclude = {"/GMKT.INC.Front.QAPIService/CertificationAPI.CreateCertificationKey"}) @Retry public interface QooJpXmlApi
如上注解已经配置JaxbConverterFactory,但是系统依然走默认配置JacksonConverterFactory 异常如下:Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 2] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1851) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:707) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:632) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1947) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:776) at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:357) at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2064) at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1485) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:33) at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23) at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243) at retrofit2.OkHttpCall.execute(OkHttpCall.java:204) at com.github.lianjiatech.retrofit.spring.boot.core.BodyCallAdapterFactory$BodyCallAdapter.adapt(BodyCallAdapterFactory.java:77) ... 104 more