Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-973

IllegalArgumentException thrown on ProtocolCodecFilter.flush

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.7
    • 2.0.8
    • Core
    • None
    • Windows Vista, jre 1.7.0_40

    Description

      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 i have 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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              melkios Simone Melchiori
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: