mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leandro Rodrigo Saad Cruz" <leandro.s...@gmail.com>
Subject Re: Close connection is message is too large
Date Thu, 21 Aug 2008 18:22:07 GMT
I noticed that exceptionCaught() method on my IoHandler just prints the
error.
Now I'm closing the connection on that method, but...

If I do somethings like this.
session.write(SomeObject);
session.close(true);

Sometimes I can read SomeObject on the client side. Sometimes I can't.
How can I be sure that SomeObject can be read before the connection is
closed?

:: Leandro



On Thu, Aug 21, 2008 at 2:49 PM, Leandro Rodrigo Saad Cruz <
leandro.saad@gmail.com> wrote:

> Hi all. I'm trying to close the client connection if the message is too
> large.
>
> I wrote a simple test that tries to send some large amout of data to the
> server, but the server seems to enter on a error loop. Throwing the same
> exceptions, over and over.
>
> org.apache.mina.filter.codec.ProtocolDecoderException:
> org.apache.mina.core.buffer.BufferDataException: dataLength: 1048826
> (Hexdump: 00 10 00 FA AC ..... )
>     at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
>     at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
>     at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:49)
>     at
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:832)
>     at
> org.apache.mina.core.filterchain.DefaultIoFilterChain$HeadFilter.messageReceived(DefaultIoFilterChain.java:616)
>     at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
>     at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:408)
>     at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:578)
>     at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:540)
>     at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:532)
>     at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:58)
>     at
> org.apache.mina.core.polling.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:857)
>     at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>     at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.mina.core.buffer.BufferDataException: dataLength:
> 1048826
>     at
> org.apache.mina.core.buffer.AbstractIoBuffer.prefixedDataAvailable(AbstractIoBuffer.java:1695)
>     at
> org.apache.mina.filter.codec.serialization.ObjectSerializationDecoder.doDecode(ObjectSerializationDecoder.java:89)
>     at
> org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:173)
>     at
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:170)
>     ... 15 more
>
> Note: I'm using the ObjectSerializationCodecFactory
>
> Any ideas?
>
> --
> Leandro Rodrigo Saad Cruz
> software developer - certified scrum master
> :: scrum.com.br
> :: db.apache.org/ojb
> :: guara-framework.sf.net
> :: xingu.sf.net
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message