I'm trying to use the Connector-attribute "address" in the Tomcat 5.5.17
I'm running, as I want the Tomcat to listen to a specific IP-address
(I'm running two Tomcats on the same server). This works fine when I'm
running the Tomcat without APR, but when I run the Tomcat with APR
enabled it refuses to start:
ERROR main org.apache.coyote.http11.Http11AprProtocol - Error
initializing
endpoint
java.lang.Exception: Socket bind failed: [22] Invalid argument
at
org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:571)
at org.apache.coyote.http11.Http11AprProtocol.init
(Http11AprProtocol.java:115)
at org.apache.catalina.connector.Connector.initialize
(Connector.java:1016)
at org.apache.catalina.core.StandardService.initialize
(StandardService.java:580)
at org.apache.catalina.core.StandardServer.initialize
(StandardServer.java:791)
at org.apache.catalina.startup.Catalina.load(Catalina.java:503)
at org.apache.catalina.startup.Catalina.load(Catalina.java:523)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
Removing the address-attribute also removes the problem.
I reported this a Tomcat bug (ASF Bugzilla Bug 39596) and received the
following answers:
------- Additional Comment #1 From Mladen Turk 2006-05-17 09:25 [reply]
-------
This is already fixed in the SVN.
The problem is with IPV4/IPV6 address.
As a helper use the IPV6 address of the 192.168.3.5
------- Additional Comment #2 From Olle Östlund 2006-05-17 11:48 [reply]
-------
I'm sorry but we have not digged in on IPV6 and have nothing configured
for IPV6
on our servers. I do not know what you want me to do to "use the IPV6
address of
the 192.168.3.5", but I suspect it won't work as we haven't implemented
IPV6.
Please give me some more hints on how to solve the problem.
------- Additional Comment #3 From Mladen Turk 2006-05-17 12:14 [reply]
-------
It doesn matter if you don't have IPv6 configured if the APR was
uild with IPv6 support.
Try address="::1" . It should bind to 127.0.0.1
Anyhow. This issue is closed, so don't use it for further discussion.
If you need more clarification use Tomcat Developers list.
-----------------------------------------------------------------------
I followed this tip and tried usin address = "::1" which works fine:
INFO main org.apache.coyote.http11.Http11AprProtocol - Initializing
Coyote HTTP/1.1 on http-0%3A0%3A0%3A0%3A0%3A0%3A0%3A1-80
INFO main org.apache.catalina.startup.Catalina - Initialization
processed in 1043 ms
INFO main org.apache.catalina.core.StandardService - Starting service
Catalina
INFO main org.apache.catalina.core.StandardEngine - Starting Servlet
Engine: Apache Tomcat/5.5.17
INFO main org.apache.catalina.cluster.tcp.SimpleTcpCluster - Cluster is
about to start
But when I try to use address = "::127.0.0.1" (which I believe should
give the same result) this does not work:
ERROR main org.apache.coyote.http11.Http11AprProtocol - Error
initializing endpoint
java.lang.Exception: Socket bind failed: [99] Cannot assign requested
address
at
org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:571)
at
org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:115)
at
org.apache.catalina.connector.Connector.initialize(Connector.java:1016)
at
org.apache.catalina.core.StandardService.initialize(StandardService.java:580)
at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:791)
at org.apache.catalina.startup.Catalina.load(Catalina.java:503)
at org.apache.catalina.startup.Catalina.load(Catalina.java:523)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Could someone please help me. How should I express the Connector
address-attribute so that the
APR-enhaced Connector will listen to a specific IPv4 address? I do not
have IPv6 setup on my server.
________________________________________________________________________