tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hans Müller" <HaMu...@gmx.net>
Subject Tomcat 5.5 and IPv6 configuration
Date Tue, 01 Aug 2006 11:49:54 GMT
Hello guys,

currently I'm trying to set-up a standalone Tomcat 5.5.17 server in an IPv6 environment on
a FreeBSD 6.1 machine. Unfortunately, Tomcat refuses to start. Here is the relevant content
of the catalina.out log-file:

SEVERE: StandardServer.await: create[8005]:
java.net.BindException: Can't assign requested address
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
        at java.net.ServerSocket.bind(ServerSocket.java:319)
        at java.net.ServerSocket.<init>(ServerSocket.java:185)
        at org.apache.catalina.core.StandardServer.await(StandardServer.java:372)
        at org.apache.catalina.startup.Catalina.await(Catalina.java:615)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

I googled for a solution to this problem, but the only one I found (several times) was to
disable the IPv6 support of the JVM by calling it with -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses.
Since I explicitely want to use IPv6 this is no solution for me.

Then I looked at the particular portion of the source code which causes the exception and
I found that the IPv4 address 127.0.0.1 is actually hardcoded several times there (in StandardServer.java,
Catalina.java and some others). Of course, the JVM cannot create an IPv6 address using this
IPv4 representation. Therefore I changed "127.0.0.1" to "localhost", recompiled Tomcat and
happily discovered that it is working now.

BUT... since I can read everywhere that Tomcat should be IPv6 compliant, this code-change
doesn't seem to be the real solution to me. Firtly I'm not the only one who is using IPv6
and secondly the developers are definitely not that stupid to hardcode an IPv4 address and
thereby break IPv6 compatibility. So, I'd like to ask you if there is a configuration-only
way to solve this issue, i.e. to avoid that StandardServer is being called?

I am using the server-minimal.xml file that is being shipped with Tomcat and an IPv6 capable
JVM 1.5.

Hans
-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
"Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message