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

Session created with non-existent service

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.4, 0.9.5, 1.0.0
    • 1.0.1
    • Core
    • None
    • Windows 2000 SP4, Java 1.5.0_08

    Description

      On Windows 2000, when attempting to connect to a service on a port where no service is running (either locally or remotely), Mina will sometimes create and open a session instead of throwing an IoException. This session is of course unusable, and when attempting to use it an exception is thrown (the following exception from Mina 0.9.4):

      java.nio.channels.NotYetConnectedException
      at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:129)
      at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:294)
      at org.apache.mina.transport.socket.nio.SocketIoProcessor.doFlush(SocketIoProcessor.java:480)
      at org.apache.mina.transport.socket.nio.SocketIoProcessor.doFlush(SocketIoProcessor.java:412)
      at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$500(SocketIoProcessor.java:41)
      at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:568)

      This is reproducible within a few seconds with the attached test case on Windows 2000 on Mina 0.9.4 and Mina 1.0.0. I also attempted to reproduce this on Linux 2.6.17 but was unable to.

      I have attached two test cases, one MinaConnectTest and one MinaConnectTest10, the former is for 0.9.4 and the latter is for 1.0.0 – the only change is the exception caught.

      Though the attached test case fails uses only localhost (to avoid DNS complications), the test case also fails if a remote host is used. I tested with a remote host running Solaris 8 from a Windows client.

      Lastly, netcat in a tight loop was used concurrently with the test to verify that the port was indeed refusing connections.

      Attachments

        1. MinaConnectTest.java
          1 kB
          Raman Gupta
        2. MinaConnectTest10.java
          1 kB
          Raman Gupta
        3. MinaConnectTestNew.java
          2 kB
          Raman Gupta

        Activity

          People

            trustin Trustin Lee
            rocketraman Raman Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: