Issue Details (XML | Word | Printable)

Key: DIRMINA-163
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Niklas Therning
Reporter: Alex Karasulu
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MINA

Build fails with failed SocketBindTest

Created: 11/Jan/06 10:47 AM   Updated: 26/May/09 12:48 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.9.3

Time Tracking:
Not Specified

Environment:
Windows XP Pro
Version 2002
Service Pack 2

$ java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

$ mvn -version
Maven version: 2.0.1

Resolution Date: 25/Mar/06 09:54 AM


 Description  « Hide
$ less org.apache.mina.transport.socket.nio.SocketBindTest.txt
-------------------------------------------------------------------------------
Battery: org.apache.mina.transport.socket.nio.SocketBindTest
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 1, Time elapsed: 4.078 sec

testUnbindDisconnectsClients(org.apache.mina.transport.socket.nio.SocketBindTest
) Time elapsed: 0.047 sec <<< ERROR!
...

[ stacktrace ] -----------------------------------------------------------

java.net.BindException: Cannot assign requested address: no further information
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:525
)
        at org.apache.mina.transport.socket.nio.support.SocketConnectorDelegate.
processSessions(SocketConnectorDelegate.java:223)
        at org.apache.mina.transport.socket.nio.support.SocketConnectorDelegate.
access$800(SocketConnectorDelegate.java:49)
        at org.apache.mina.transport.socket.nio.support.SocketConnectorDelegate$
Worker.run(SocketConnectorDelegate.java:321)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Niklas Therning added a comment - 15/Jan/06 11:05 PM
Under Linux I can't reproduce this exact problem. However, sometimes I get a ConnectException. If I change the line

  bind( false );

into

  bind( true );

and change the line

  ConnectFuture future = connector.connect( addr, new IoHandlerAdapter() );

into

  ConnectFuture future = connector.connect( new InetSocketAddress( "localhost", port ),
                                                                                new IoHandlerAdapter() );

my ConnectException problem seems to go away. It would be great if you could try this under Windows and see if the BindException problem persists. I'm afraid I don't have access to a Windows installation so I can't test it myself. Adding the test method below could be helpful

  public void testALot() throws Exception
  {
    for( int i = 0; i < 100; i++ )
    {
      System.out.println( "Test run " + i );
      testUnbindDisconnectsClients();
    }
  }


Emmanuel Lecharny added a comment - 24/Jan/06 03:39 AM
I still had the problem on Linux Ubuntu 5.0.4.

I fiexd it in maven by adding this parameter in mvn script :
exec "$JAVACMD" \
  -Djava.net.preferIPv4Stack=true \ <<<<<---------------------
  $MAVEN_OPTS \
  -classpath "${M2_HOME}"/core/boot/classworlds-*.jar \
  "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
  "-Dmaven.home=${M2_HOME}" \
  ${CLASSWORLDS_LAUNCHER} $@


Seems that Mina does not like IPV6 !!!

Emmanuel Lecharny added a comment - 24/Jan/06 03:40 AM
downgrade from blocker to major.

Trustin Lee added a comment - 24/Jan/06 02:50 PM
Let's investigate into this issue more and release 0.9.1 without resolving it for now.

Trustin Lee added a comment - 12/Mar/06 12:27 AM
Any updates?

Niklas Therning added a comment - 23/Mar/06 02:08 AM
I cannot reproduce this on my computer. I'm running Ubuntu 5.10 here and as far as I can tell IPv6 is enabled:

niklas@niklas:~/Projects/mina$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:03:0D:07:E0:63
          inet addr:192.168.0.138 Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::203:dff:fe07:e063/64 Scope:Link
          ...
niklas@niklas:~/Projects/mina$ ping6 -I eth0 fe80::203:dff:fe07:e063
PING fe80::203:dff:fe07:e063(fe80::203:dff:fe07:e063) from fe80::203:dff:fe07:e063 eth0: 56 data bytes
64 bytes from fe80::203:dff:fe07:e063: icmp_seq=1 ttl=64 time=0.046 ms
64 bytes from fe80::203:dff:fe07:e063: icmp_seq=2 ttl=64 time=0.057 ms
...
niklas@niklas:~/Projects/mina$ ping6 -I lo ::1
PING ::1(::1) from ::1 lo: 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.046 ms
...

niklas@niklas:~/Projects/mina$ java -version
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

niklas@niklas:~/Projects/mina$ uname -a
Linux niklas 2.6.12-10-k7 #1 Sat Mar 11 16:59:38 UTC 2006 i686 GNU/Linux

Emmanuel, could you verify that this is still an issue for you? If yes, please describe your Java/Linux setup (e.g. is only the lo network interface available).

Does anyone else have problems with the SocketBindTest?

Trustin Lee added a comment - 23/Mar/06 03:14 PM
I tested both on Debian Linux and on Windows XP professional, but I couldn't reproduce the problem, either.

It would be nice if we can mark this issue as 'can't reproduce' unless there's any objection.