You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Simone Melchiori (JIRA)" <ji...@apache.org> on 2013/11/27 17:50:35 UTC

[jira] [Created] (DIRMINA-973) IllegalArgumentException thrown on ProtocolCodecFilter.flush

Simone Melchiori created DIRMINA-973:
----------------------------------------

             Summary: IllegalArgumentException thrown on ProtocolCodecFilter.flush
                 Key: DIRMINA-973
                 URL: https://issues.apache.org/jira/browse/DIRMINA-973
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.7
         Environment: Windows Vista, jre 1.7.0_40
            Reporter: Simone Melchiori


With multiple threads that write messages to a mina session.

Sometimes i have this exception trace:

org.apache.mina.filter.codec.ProtocolEncoderException: java.lang.IllegalArgumentException: message
	at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:339)
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:482)
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:47)
	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:775)
	at org.apache.mina.filter.executor.ExecutorFilter.filterWrite(ExecutorFilter.java:614)
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:482)
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:47)
	at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:775)
	at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:84)
	at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)
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)

I've mad some debug on mina source code and i've found that in ProtocolCodecFilter ther's this code at line: 446:

if (future == null) {
                // Creates an empty writeRequest containing the destination
                WriteRequest writeRequest = new DefaultWriteRequest(null, null, destination);

But this method doesn't work because seeing DefaultWriteRequest constructor ther's this code:

public DefaultWriteRequest(Object message, WriteFuture future, SocketAddress destination) {
        if (message == null) {
            throw new IllegalArgumentException("message");
        }

Should be a bug.
In my case i0ve this exception but i don't have some real problem. I think that many flush on same session 'steal' messages to write on flush each other.

I don't have application problem. The messages seem to arrive at client side, but i have some stack trace exception and after session close i've seen from jmx that there are some statistics.writeScheduledMessages with none sessions active.



--
This message was sent by Atlassian JIRA
(v6.1#6144)