You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Supun Kamburugamuva <su...@gmail.com> on 2010/11/24 14:47:14 UTC
Intermittent Exception while submitting a response
While submitting a response with HttpCore-NIO I get the following exception.
This happens after some messages have being successfully transferred. Any
pointers, that guide me in the write direction to figure out what went wrong
would be much appreciated.
java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:218)
at sun.nio.cs.US_ASCII$Encoder.encodeArrayLoop(US_ASCII.java:161)
at sun.nio.cs.US_ASCII$Encoder.encodeLoop(US_ASCII.java:193)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:544)
at
org.apache.http.impl.nio.reactor.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:158)
at
org.apache.http.impl.nio.codecs.DefaultHttpResponseWriter.writeHeadLine(DefaultHttpResponseWriter.java:57)
at
org.apache.http.impl.nio.codecs.DefaultHttpResponseWriter.writeHeadLine(DefaultHttpResponseWriter.java:44)
at
org.apache.http.impl.nio.codecs.AbstractMessageWriter.write(AbstractMessageWriter.java:90)
at
org.apache.http.impl.nio.DefaultNHttpServerConnection.submitResponse(DefaultNHttpServerConnection.java:241)
Thanks,
Supun..
Re: Intermittent Exception while submitting a response
Posted by Supun Kamburugamuva <su...@gmail.com>.
This was due to the way in which connections were handled. When I changed it
this worked. But I couldn't pin point the cause because there were lots of
changes.
Thanks,
Supun..
On Wed, Nov 24, 2010 at 7:49 PM, Oleg Kalnichevski <ol...@apache.org> wrote:
> On Wed, 2010-11-24 at 19:17 +0530, Supun Kamburugamuva wrote:
> > While submitting a response with HttpCore-NIO I get the following
> exception.
> > This happens after some messages have being successfully transferred. Any
> > pointers, that guide me in the write direction to figure out what went
> wrong
> > would be much appreciated.
> >
> > java.lang.IllegalArgumentException
> > at java.nio.Buffer.position(Buffer.java:218)
> > at sun.nio.cs.US_ASCII$Encoder.encodeArrayLoop(US_ASCII.java:161)
> > at sun.nio.cs.US_ASCII$Encoder.encodeLoop(US_ASCII.java:193)
> > at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:544)
> > at
> >
> org.apache.http.impl.nio.reactor.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:158)
> > at
> >
> org.apache.http.impl.nio.codecs.DefaultHttpResponseWriter.writeHeadLine(DefaultHttpResponseWriter.java:57)
> > at
> >
> org.apache.http.impl.nio.codecs.DefaultHttpResponseWriter.writeHeadLine(DefaultHttpResponseWriter.java:44)
> > at
> >
> org.apache.http.impl.nio.codecs.AbstractMessageWriter.write(AbstractMessageWriter.java:90)
> > at
> >
> org.apache.http.impl.nio.DefaultNHttpServerConnection.submitResponse(DefaultNHttpServerConnection.java:241)
> >
> >
> > Thanks,
> > Supun..
>
> Hi Supun
>
> The exception is thrown by a non-public JRE class, so I cannot
> definitively say as to what is likely to be the cause of the problem. I
> can only guess that this might be due to a non-ASCII character in the
> HTTP message head.
>
> Can you reproduce the issue with a test case independently from Synapse?
>
> Cheers
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>
--
Technical Lead, WSO2 Inc
http://wso2.org
supunk.blogspot.com
Re: Intermittent Exception while submitting a response
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2010-11-24 at 19:17 +0530, Supun Kamburugamuva wrote:
> While submitting a response with HttpCore-NIO I get the following exception.
> This happens after some messages have being successfully transferred. Any
> pointers, that guide me in the write direction to figure out what went wrong
> would be much appreciated.
>
> java.lang.IllegalArgumentException
> at java.nio.Buffer.position(Buffer.java:218)
> at sun.nio.cs.US_ASCII$Encoder.encodeArrayLoop(US_ASCII.java:161)
> at sun.nio.cs.US_ASCII$Encoder.encodeLoop(US_ASCII.java:193)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:544)
> at
> org.apache.http.impl.nio.reactor.SessionOutputBufferImpl.writeLine(SessionOutputBufferImpl.java:158)
> at
> org.apache.http.impl.nio.codecs.DefaultHttpResponseWriter.writeHeadLine(DefaultHttpResponseWriter.java:57)
> at
> org.apache.http.impl.nio.codecs.DefaultHttpResponseWriter.writeHeadLine(DefaultHttpResponseWriter.java:44)
> at
> org.apache.http.impl.nio.codecs.AbstractMessageWriter.write(AbstractMessageWriter.java:90)
> at
> org.apache.http.impl.nio.DefaultNHttpServerConnection.submitResponse(DefaultNHttpServerConnection.java:241)
>
>
> Thanks,
> Supun..
Hi Supun
The exception is thrown by a non-public JRE class, so I cannot
definitively say as to what is likely to be the cause of the problem. I
can only guess that this might be due to a non-ASCII character in the
HTTP message head.
Can you reproduce the issue with a test case independently from Synapse?
Cheers
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org