0
有効な市民のアドレスに対してJSONを返すRESTエンドポイントを呼び出そうとしています。nullストリームの入力ストリームからエンティティを読み取るときにエラーが発生しました
{
"success":false,
"results":null,
"error":{
"code":123,
"message":"Invalid Civic Address. Valid Example: 123 Main St, My City...",
"details":[
"The civic address submitted to the service contained an alphabetic character where a number was expected."
]
}
}
:私はこのような、私は戻って戻って何かサービスを扱うことができない形式のリクエストを送信する場合は
{
"success":true,
"results":[
{
"civicnumberid":123456,
"civic_address_as_string":"123 Main Street, My City, My Municipality, My County",
"esri_point":{
"x":12345.678,
"y":54321.012
}
}
],
"error":null
}
:呼び出しが成功で、私は戻って、このような何かを得ます「結果」に注意してください。ヌル JAX-RS 2.0とJackson 2.5.1を使用してレスポンスを変換しようとしているときに、「入力ストリームからエンティティを読み取る際にエラーが発生しました」というエラーが表示されて失敗します。
defaultObjectMapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true)
.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true)
.configure(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS, true)
.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)
.configure(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT, true)
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
マイResponseObject JAXBオブジェクトです::
public class ResponseObject
implements Serializable
{
private final static long serialVersionUID = 1L;
protected Boolean success;
@XmlElement(nillable = true)
protected List<Result> results;
@XmlElement(nillable = true)
protected Error error;
でき「結果」:ヌルが正常に処理されたり、私が戻るために、サービスプロバイダで動作するはずです。ここに私の現在ObjectMapperの設定です空のリスト?