[jira] [Commented] (CXF-8726) org.apache.cxf.jaxrs.client.ResponseExceptionMapper cannot evaluate response body in case of retries and org.apache.cxf.transport.service_not_available being true

2022-07-06 Thread Andriy Redko (Jira)


[ 
https://issues.apache.org/jira/browse/CXF-8726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17563538#comment-17563538
 ] 

Andriy Redko commented on CXF-8726:
---

[~kwin] I was trying to reproduce the issue with {{ResponseExceptionMapper + 
Response::readEntity(Class) but I don't observer the same sequence: at least 
for me the }}{{ResponseExceptionMapper is called before 
}}FailoverTargetSelector::complete(), entity is never read as `null`. Would you 
mind to provide reproducible test case for it? Thank you.

 

> org.apache.cxf.jaxrs.client.ResponseExceptionMapper cannot evaluate response 
> body in case of retries and org.apache.cxf.transport.service_not_available 
> being true
> --
>
> Key: CXF-8726
> URL: https://issues.apache.org/jira/browse/CXF-8726
> Project: CXF
>  Issue Type: Bug
>  Components: JAX-RS
>Affects Versions: 3.5.2
>Reporter: Konrad Windszus
>Priority: Major
>
> I have registered a custom 
> {{org.apache.cxf.jaxrs.client.ResponseExceptionMapper}}. In case the request 
> is retried (in my case via a {{org.apache.cxf.clustering.FailoverFeature}} 
> leveraging a {{RetryStrategy}}), the custom response exception mapper gets 
> {{null}} as return value for {{response.readEntity(Class)}} in its 
> {{fromResponse(Response response}} method as it seems this one can not/no 
> longer access the response body.
> IMHO javax.ws.rs.core.Response.readEntity(...) must never return null but 
> rather throw an exception (compare with its javadoc at 
> https://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Response.html#readEntity-java.lang.Class-).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CXF-8726) org.apache.cxf.jaxrs.client.ResponseExceptionMapper cannot evaluate response body in case of retries

2022-06-20 Thread Konrad Windszus (Jira)


[ 
https://issues.apache.org/jira/browse/CXF-8726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17556490#comment-17556490
 ] 

Konrad Windszus commented on CXF-8726:
--

The difference with retries is that the response's entity is an 
{{java.io.SequenceInputStream}} with two input streams:
# 
{{org.apache.cxf.helpers.LoadingByteArrayOutputStream$LoadedByteArrayInputStream}}
  (containing the actual response body) and
# {{sun.net.www.protocol.http.HttpURLConnection$HttpInputStream}}

while in case of no retries, a {{java.io.SequenceInputStream}} containing only 
the first stream is returned.

The subsequent {{com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider}} can 
only deal with the latter, but not with the former (i.e. returns null).


> org.apache.cxf.jaxrs.client.ResponseExceptionMapper cannot evaluate response 
> body in case of retries
> 
>
> Key: CXF-8726
> URL: https://issues.apache.org/jira/browse/CXF-8726
> Project: CXF
>  Issue Type: Bug
>  Components: JAX-RS
>Affects Versions: 3.4.4
>Reporter: Konrad Windszus
>Priority: Major
>
> I have registered a custom 
> {{org.apache.cxf.jaxrs.client.ResponseExceptionMapper}}. In case the request 
> is retried (in my case via a {{org.apache.cxf.clustering.FailoverFeature}} 
> leveraging a {{RetryStrategy}}), the custom response exception mapper gets 
> {{null}} as return value for {{response.readEntity(Class)}} in its 
> {{fromResponse(Response response}} method as it seems this one can not/no 
> longer access the response body.
> IMHO javax.ws.rs.core.Response.readEntity(...) must never return null but 
> rather throw an exception (compare with its javadoc at 
> https://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Response.html#readEntity-java.lang.Class-).



--
This message was sent by Atlassian Jira
(v8.20.7#820007)