Skip to Content
0
Former Member
Aug 22, 2018 at 07:23 PM

Charon jetty java.io.IOException: An existing connection was forcibly closed by the remote host

284 Views

Getting this exception 20-30 seconds after reading the response when using Hybris Charon library to make a REST calls:

 ERROR [nioEventLoopGroup-2-9] [ResponseHandler] An existing connection was forcibly closed by the remote host
  java.io.IOException: An existing connection was forcibly closed by the remote host
         at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_65]
         at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:1.8.0_65]
         at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_65]
         at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_65]
         at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[?:1.8.0_65]
         at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288) ~[netty-buffer-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100) ~[netty-buffer-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:367) ~[netty-transport-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:118) [netty-transport-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:610) [netty-transport-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:551) [netty-transport-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:465) [netty-transport-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:437) [netty-transport-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873) [netty-common-4.1.5.Final.jar:4.1.5.Final]
         at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) [netty-common-4.1.5.Final.jar:4.1.5.Final]
         at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]

Error is caught in com.hybris.charon.netty.ResponseHandler#exceptionCaught during read in io.netty.channel.nio.AbstractNioByteChannel.NioByteUnsafe#read

Is there a way to fix it?

Our http client is simple:

 @Http(value = "http")
 @Control(timeout = "${timeout:2000}")
 public interface OrderClient {
 
     @POST
     @Path("/sap/salesorder/simulate")
     @Produces(MediaType.APPLICATION_JSON)
     @Consumes(MediaType.APPLICATION_JSON)
     Observable<ScpiResponse> sendOrder(@HeaderParam("Authorization") String oauthToken, ScpiRequest request);
 
 }