Last weekend I tried to configure Tomcat to use APR library to boost performance. The build and setup went smoothly. But when I started Tomcat I got the following error:
INFO: Loaded Apache Tomcat Native library 1.1.10.
Sep 7, 2007 6:05:16 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false],
random [true].
Sep 7, 2007 6:05:16 PM org.apache.coyote.http11.Http11AprProtocol init
SEVERE: Error initializing endpoint
java.lang.Exception: Socket bind failed: [22] Invalid argument
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:612)
at
org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:121)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1059)After several debug sessions over Tomcat’s source it appeared that the Connector’s attribute address should be set to machine’s IP. For test purposes it can be 127.0.0.1. However for the server which is connected to the internet this attribute is not neccessary. On this server Tomcat is launched without this attribute :)
First published on the old anydoby.com blog on 2007-10-09.