You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Deepak Kumar <de...@gmail.com> on 2017/02/24 08:16:07 UTC

Getting Exception "java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode" with CXF 2.2.12

Hi All,

I am getting the 401 Unauthorized while invoking the webservice, it works
for some time but after around 2 hours the CXF API starts throwing
exception, I was using my other JAxWS API which does not show this error.
All the subsequent invocation throws this exception until I restart my
Application service. Please help me what could be the problem.

Interceptor for {XXXXXX#{http://cxf.apache.org/jaxws/dispatch}Invoke has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:300)
at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:332)
at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:218)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: HTTP response '401: Unauthorized' invoking
XXXXXX with NO authorization username configured in conduit
{XXXXXX}YYY.http-conduit
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2167)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:695)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 22 more
Caused by: java.net.HttpRetryException: cannot retry due to server
authentication, in streaming mode
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown
Source)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2305)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2274)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2119)
... 25 more

javax.xml.ws.WebServiceException: Could not send Message.
at org.apache.cxf.jaxws.DispatchImpl.mapException(DispatchImpl.java:244)
at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:339)
at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:218)
at
com.realops.adapter.ws.soap.dispatch.MessageClient.invoke(MessageClient.java:393)
at
com.realops.adapter.ws.soap.SoapRpcActorAdapter.performAction(SoapRpcActorAdapter.java:1166)
at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke(ContextClassLoaderDecoratorFactory.java:79)
at
com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)
at com.sun.proxy.$Proxy165.performAction(Unknown Source)
at
com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2561)
at
com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:403)
at
com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)
at
com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:427)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: HTTP response '401: Unauthorized' invoking
https://XXXXX with NO authorization username configured in conduit
{XXXXXX}YYYY.http-conduit
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2167)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:695)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:300)
at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:332)
... 16 more
Caused by: java.net.HttpRetryException: cannot retry due to server
authentication, in streaming mode
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown
Source)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2305)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2274)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2119)
... 25 more

--Deepak

Re: Getting Exception "java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode" with CXF 2.2.12

Posted by Deepak Kumar <de...@gmail.com>.
Please help, this problem only occurs against WCF webservices, also please
let me know how to enable debug logging on CXF library to troubleshoot the
issue to find the root cause?

Thanks,
Deepak

On Feb 27, 2017 5:11 PM, "Deepak Kumar" <de...@gmail.com> wrote:

> Any help would be greatly appreciated. We are setting cookie in HTTP
> headers, is it possible the headers ones set are cached and used for all
> subsequent requests and invocation won't refreshed with new value?
>
> Thanks,
> Deepak
>
> On Fri, Feb 24, 2017 at 1:46 PM, Deepak Kumar <de...@gmail.com> wrote:
>
>> Hi All,
>>
>> I am getting the 401 Unauthorized while invoking the webservice, it works
>> for some time but after around 2 hours the CXF API starts throwing
>> exception, I was using my other JAxWS API which does not show this error.
>> All the subsequent invocation throws this exception until I restart my
>> Application service. Please help me what could be the problem.
>>
>> Interceptor for {XXXXXX#{http://cxf.apache.org/jaxws/dispatch}Invoke has
>> thrown exception, unwinding now
>> org.apache.cxf.interceptor.Fault: Could not send Message.
>> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageS
>> enderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
>> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
>> InterceptorChain.java:243)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
>> at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:300)
>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:332)
>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:218)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: HTTP response '401: Unauthorized'
>> invoking XXXXXX with NO authorization username configured in conduit
>> {XXXXXX}YYY.http-conduit
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.close(HTTPConduit.java:2167)
>> at org.apache.cxf.transport.AbstractConduit.close(AbstractCondu
>> it.java:66)
>> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:695)
>> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageS
>> enderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>> ... 22 more
>> Caused by: java.net.HttpRetryException: cannot retry due to server
>> authentication, in streaming mode
>> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
>> Source)
>> at java.net.HttpURLConnection.getResponseCode(Unknown Source)
>> at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown
>> Source)
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.handleResponseInternal(HTTPConduit.java:2305)
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.handleResponse(HTTPConduit.java:2274)
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.close(HTTPConduit.java:2119)
>> ... 25 more
>>
>> javax.xml.ws.WebServiceException: Could not send Message.
>> at org.apache.cxf.jaxws.DispatchImpl.mapException(DispatchImpl.java:244)
>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:339)
>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:218)
>> at com.realops.adapter.ws.soap.dispatch.MessageClient.invoke(Me
>> ssageClient.java:393)
>> at com.realops.adapter.ws.soap.SoapRpcActorAdapter.performActio
>> n(SoapRpcActorAdapter.java:1166)
>> at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at com.realops.common.util.proxy.ContextClassLoaderDecoratorFac
>> tory$IsolatedInvocationHandler.doInvoke(ContextClassLoaderDe
>> coratorFactory.java:79)
>> at com.realops.common.util.proxy.AbstractInvocationHandler.invo
>> ke(AbstractInvocationHandler.java:89)
>> at com.sun.proxy.$Proxy165.performAction(Unknown Source)
>> at com.realops.foundation.adapterframework.AdapterManager.perfo
>> rmAction(AdapterManager.java:2561)
>> at com.realops.foundation.adapterframework.DefaultAdapterProxy.
>> performActionImpl(DefaultAdapterProxy.java:403)
>> at com.realops.foundation.adapterframework.DefaultAdapterProxy.
>> access$000(DefaultAdapterProxy.java:69)
>> at com.realops.foundation.adapterframework.DefaultAdapterProxy$
>> 1.run(DefaultAdapterProxy.java:427)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: java.io.IOException: HTTP response '401: Unauthorized'
>> invoking https://XXXXX with NO authorization username configured in
>> conduit {XXXXXX}YYYY.http-conduit
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.close(HTTPConduit.java:2167)
>> at org.apache.cxf.transport.AbstractConduit.close(AbstractCondu
>> it.java:66)
>> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:695)
>> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageS
>> enderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
>> InterceptorChain.java:243)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
>> at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:300)
>> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:332)
>> ... 16 more
>> Caused by: java.net.HttpRetryException: cannot retry due to server
>> authentication, in streaming mode
>> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
>> Source)
>> at java.net.HttpURLConnection.getResponseCode(Unknown Source)
>> at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown
>> Source)
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.handleResponseInternal(HTTPConduit.java:2305)
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.handleResponse(HTTPConduit.java:2274)
>> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStrea
>> m.close(HTTPConduit.java:2119)
>> ... 25 more
>>
>> --Deepak
>>
>
>

Re: Getting Exception "java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode" with CXF 2.2.12

Posted by Deepak Kumar <de...@gmail.com>.
Any help would be greatly appreciated. We are setting cookie in HTTP
headers, is it possible the headers ones set are cached and used for all
subsequent requests and invocation won't refreshed with new value?

Thanks,
Deepak

On Fri, Feb 24, 2017 at 1:46 PM, Deepak Kumar <de...@gmail.com> wrote:

> Hi All,
>
> I am getting the 401 Unauthorized while invoking the webservice, it works
> for some time but after around 2 hours the CXF API starts throwing
> exception, I was using my other JAxWS API which does not show this error.
> All the subsequent invocation throws this exception until I restart my
> Application service. Please help me what could be the problem.
>
> Interceptor for {XXXXXX#{http://cxf.apache.org/jaxws/dispatch}Invoke has
> thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not send Message.
> at org.apache.cxf.interceptor.MessageSenderInterceptor$
> MessageSenderEndingInterceptor.handleMessage(
> MessageSenderInterceptor.java:64)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:243)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:300)
> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:332)
> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:218)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.io.IOException: HTTP response '401: Unauthorized' invoking
> XXXXXX with NO authorization username configured in conduit
> {XXXXXX}YYY.http-conduit
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
> HTTPConduit.java:2167)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:695)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$
> MessageSenderEndingInterceptor.handleMessage(
> MessageSenderInterceptor.java:62)
> ... 22 more
> Caused by: java.net.HttpRetryException: cannot retry due to server
> authentication, in streaming mode
> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
> Source)
> at java.net.HttpURLConnection.getResponseCode(Unknown Source)
> at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown
> Source)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
> handleResponseInternal(HTTPConduit.java:2305)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
> handleResponse(HTTPConduit.java:2274)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
> HTTPConduit.java:2119)
> ... 25 more
>
> javax.xml.ws.WebServiceException: Could not send Message.
> at org.apache.cxf.jaxws.DispatchImpl.mapException(DispatchImpl.java:244)
> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:339)
> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:218)
> at com.realops.adapter.ws.soap.dispatch.MessageClient.invoke(
> MessageClient.java:393)
> at com.realops.adapter.ws.soap.SoapRpcActorAdapter.performAction(
> SoapRpcActorAdapter.java:1166)
> at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$
> IsolatedInvocationHandler.doInvoke(ContextClassLoaderDecoratorFac
> tory.java:79)
> at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(
> AbstractInvocationHandler.java:89)
> at com.sun.proxy.$Proxy165.performAction(Unknown Source)
> at com.realops.foundation.adapterframework.AdapterManager.performAction(
> AdapterManager.java:2561)
> at com.realops.foundation.adapterframework.DefaultAdapterProxy.
> performActionImpl(DefaultAdapterProxy.java:403)
> at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$
> 000(DefaultAdapterProxy.java:69)
> at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(
> DefaultAdapterProxy.java:427)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.io.IOException: HTTP response '401: Unauthorized' invoking
> https://XXXXX with NO authorization username configured in conduit
> {XXXXXX}YYYY.http-conduit
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
> HTTPConduit.java:2167)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:695)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$
> MessageSenderEndingInterceptor.handleMessage(
> MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:243)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:300)
> at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:332)
> ... 16 more
> Caused by: java.net.HttpRetryException: cannot retry due to server
> authentication, in streaming mode
> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
> Source)
> at java.net.HttpURLConnection.getResponseCode(Unknown Source)
> at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown
> Source)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
> handleResponseInternal(HTTPConduit.java:2305)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
> handleResponse(HTTPConduit.java:2274)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
> HTTPConduit.java:2119)
> ... 25 more
>
> --Deepak
>