[ 
https://issues.apache.org/jira/browse/DIRMINA-982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117195#comment-14117195
 ] 

Emmanuel Lecharny commented on DIRMINA-982:
-------------------------------------------

Got it now !!!

Good catch. We need to inject a empty object (it can be an instance of a class 
like EmptyMessage, a class we can create for this purpose).

Let me try that.

> ProtocolEncoderOutputImpl.flush() throws an IllegalArgumentException if 
> buffers queue is empty
> ----------------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-982
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-982
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.7
>            Reporter: Jenya Pisarenko
>
> https://git-wip-us.apache.org/repos/asf?p=mina.git;a=blob;f=mina-core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java;h=f413491e058ff1c5a24c3b2ccae6d736f481bbaf;hb=2.0#l428
> First, flush method initializes WriteFuture with a null reference.
> The object can be constructed later, if buffers queue isn't empty, but 
> otherwise remains untouched. 
> If it still holds a null reference, the DefaultWriteRequest constructor call 
> always fails, as it doesn't accept null as a message param.
> Excerpt from the stack trace:
> {noformat}
> Caused by: java.lang.IllegalArgumentException: message
> at 
> org.apache.mina.core.write.DefaultWriteRequest.<init>(DefaultWriteRequest.java:133)
> at 
> org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolEncoderOutputImpl.flush(ProtocolCodecFilter.java:448)
> at com.ugcs.messaging.mina.MinaEncoder.encode(MinaEncoder.java:27)
> at 
> org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:308)
> ... 33 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to