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 <[email protected]>:
> 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) {
>