mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Rodriges <antonio....@gmail.com>
Subject Re: Message size
Date Thu, 16 Oct 2014 16:43:05 GMT
If

The default value
     * is {@link Integer#MAX_VALUE}.

so why it is not working by default?

In my code I have only

        acceptor.getFilterChain().addLast("codec",
                new ProtocolCodecFilter(CodecFactory.getInstance()));

and do not  define my own codecs.

ProtocolCodecFilter does not have setMaxObjectSize

2014-10-16 18:54 GMT+03:00 Emmanuel Lécharny <elecharny@gmail.com>:
> Le 16/10/14 17:42, Antonio Rodriges a écrit :
>> Hello,
>>
>> got
>> org.apache.mina.filter.codec.ProtocolEncoderException:
>> java.lang.IllegalArgumentException: The encoded object is too big:
>> 5047249 (> 4194304)
>
> It means you are trying to encode an Object that is too big, when you
> have limited the size of the bigger object you can encode to 4194304
> (which is 0x4000000)
>
> Change the maxObjectSize in your codec :
>
>     /**
>      * Sets the allowed maximum size of the encoded object.
>      * If the size of the encoded object exceeds this value, this encoder
>      * will throw a {@link IllegalArgumentException}.  The default value
>      * is {@link Integer#MAX_VALUE}.
>      */
>     public void setMaxObjectSize(int maxObjectSize) {
>

Mime
View raw message