Bug 44505 - socket bindexception in tomcat 6 on pure ipv6 solaris
Summary: socket bindexception in tomcat 6 on pure ipv6 solaris
Status: RESOLVED DUPLICATE of bug 43588
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.13
Hardware: Other SunOS
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-28 06:24 UTC by Mallik Soupati
Modified: 2008-03-31 14:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mallik Soupati 2008-02-28 06:24:36 UTC
I tried many ports. I am sure that all the ports I tried were free.
And this port is a shut down port.
My machine:SunOS uni6505l1-sun1 5.10 Generic sun4u sparc SUNW,Sun-Fire-V440

2008-02-28 13:22:21,380 6047 [main] ERROR
org.apache.catalina.core.StandardServer  - StandardServer.await: create[17008]:
java.net.BindException: Cannot assign requested address
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(Unknown Source)
        at java.net.ServerSocket.bind(Unknown Source)
        at java.net.ServerSocket.<init>(Unknown Source)
        at org.apache.catalina.core.StandardServer.await(StandardServer.java:373)
        at org.apache.catalina.startup.Catalina.await(Catalina.java:630)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:590)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

below is my ifconfig -a. removed some parts of the address.

 1
        inet6 ::1/128
ce0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
        inet6 fe80::214:4fff:fe74:dc80/10
        ether 0:14:4f:74:dc:80
ce0:1: flags=2080841<UP,RUNNING,MULTICAST,ADDRCONF,IPv6> mtu 1500 index 2
        inet6 2001:d(removed this part)c80/64
ce0:2: flags=2080841<UP,RUNNING,MULTICAST,ADDRCONF,IPv6> mtu 1500 index 2
        inet6 2002(removed this part)dc80/64
ce0:3: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
        inet6 fd00(removed this part)dc80/128

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206527 <<<< is this something to do?


thanks.
Comment 1 Mallik Soupati 2008-02-28 06:42:52 UTC
I happened to see that there is no IPv6 code at these lines of code.
IPv6 loop-back address is also needed to be tried.

file : StandardServer.java
lines : 370 to 380
ServerSocket serverSocket = null;
try {
   serverSocket =
   new ServerSocket(port, 1,
       InetAddress.getByName("127.0.0.1"));
} catch (IOException e) {
   log.error("StandardServer.await: create[" + port + "]: ", e);
   System.exit(1);
}
Comment 2 Mallik Soupati 2008-02-28 21:09:25 UTC
If it is the loop-back address we are trying to bind to, "InetAddress.getByName(null);" in ServerSocket constructor will do it for us in protocol independent way.


Comment 3 Mark Thomas 2008-03-31 14:55:47 UTC
InetAddress.getByName(null); might be more elegant but I believe the fix for the duplicate also addresses this. The fix is in 6.0.16 onwards.

*** This bug has been marked as a duplicate of bug 43588 ***