Details
Description
At first: I'm not sure if this is a CXF issue or a infrastructure problem in the customer-environment.
Currently wa have an APP_SERVER_OLD that calls services from SAP_SERVER without issues.
Now we moved from APP_SERVER_OLD to APP_SERVER_NEW but still using SAP_SERVER:
On APP_SERVER_NEW we have the problem, that after an async-Soap-Service-call (method has @Oneway-annotation) we get an IOException: stream is closed during closing of the the InputStream.
Calling non-@Oneway services works as expected on APP_SERVER_NEW.
Currently I assume that this is a infrastructure-problem because we are using the same software-version on APP_SERVER_OLD and APP_SERVER_NEW.
Unfortunately I don't have a testcase.
Does anyone know why this can happen?
Or is this maybe a bug in CXF?
Here is the relevant part of the stacktrace:
stream is closed sun.net.www.http.ChunkedInputStream.ensureOpen(ChunkedInputStream.java:174) sun.net.www.http.ChunkedInputStream.available(ChunkedInputStream.java:718) java.io.FilterInputStream.available(FilterInputStream.java:168) org.apache.cxf.helpers.IOUtils.consume(IOUtils.java:305) org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.closeInputStream(URLConnectionHTTPConduit.java:261) org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1597) org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1520) org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1317) org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632) org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572) org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481) org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382) org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335) org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136) com.sun.proxy.$Proxy113.oaAssetDataSend(Unknown Source)
As you can see this error occurs because IOUtils.consume is called during close thile the stream is already closed.
I know that 2.7.18 is an old version but this can also happen in current versions:
Maybe you can check if the stream is already closed?
Is there something we can do to prevent this error?