synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiranya Jayathilaka <>
Subject Re: Why is "java.nio.channels.ClosedChannelException" thrown from Nio Reactor?
Date Mon, 19 Aug 2013 17:46:43 GMT
[Dropped hc list]

Hi Jeewantha,

What's your Synapse configuration? What steps did you have to go through to get this error?
Please specify the exact details, so we can try to reproduce the problem.

Also as Oleg has mentioned, a wire-level log would be very helpful. Enable DEBUG for the org.apache.synapse.transports
package in the to enable this.


On Aug 19, 2013, at 1:48 AM, Jeewantha Dharmaparakrama <> wrote:

> Hi All,
> I have an intermittent issue with Synapse where it prints the following exception in
its Error logs.
> [2013-08-15 16:57:28,710] ERROR - SourceHandler Unexpected I/O error: java.nio.channels.ClosedChannelException
> java.nio.channels.ClosedChannelException
> at
> at
> at org.apache.http.impl.nio.reactor.SessionOutputBufferImpl.flush(
> at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(
> at org.apache.synapse.transport.http.conn.LoggingNHttpServerConnection.produceOutput(
> at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(
> at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(
> at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(
> at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(
> at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(
> at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(
> at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(
> at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(
> at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$
> at
> What happens is for some reason, the corresponding SocketChannel is closed but still
some IO operation is done on it. Once this exception is caught from httpcore-nio, it will
be passed to org.apache.http.nio.NHttpServerEventHandler implementation ( org.apache.synapse.transport.passthru.SourceHandler
) and will be printed on Synapse Error logs. Since this is an intermittent issue,
> I tried to reproduce this programmatically but failed [1]. What can be the practical
reason for this Error? Can this be deliberately reproduced with Synapse?
> [1] 
> Thanks in advance,
> Jeewantha.

Hiranya Jayathilaka
Mayhem Lab/RACE Lab;
Dept. of Computer Science, UCSB;
E-mail:;  Mobile: +1 (805) 895-7443

View raw message