RE: java.net.BindException: Address already in use
I am not clear on the question as I inserted the log file in the early emails. Paul Paul Bourget Isabella Products -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Tuesday, August 31, 2010 3:21 PM To: Tomcat Users List Subject: Re: java.net.BindException: Address already in use -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, On 8/31/2010 3:07 PM, Paul Bourget wrote: I compared the server.xml file to the one used on the production servers and it was the same except for the ip addresses. During bootup I get the failure but when I run the Catalina.sh start command, tomcat starts up fine. So, it only fails on system boot? Okay, what happens at system boot, then? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkx9VjUACgkQ9CaO5/Lv0PCNSgCgoUQF9ZAbv79Zavy/PAyIqPuV fswAoJ/n4ysGbLyaZQz1HkCdIIOfSGtC =lHMM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: java.net.BindException: Address already in use
I compared the server.xml file to the one used on the production servers and it was the same except for the ip addresses. During bootup I get the failure but when I run the Catalina.sh start command, tomcat starts up fine. Apache is not running though, so still no web services. [r...@localhost tomcat]# /usr/local/netomat/tomcat5.5.23/bin/catalina.sh start Using CATALINA_BASE: /usr/local/netomat/tomcat5.5.23 Using CATALINA_HOME: /usr/local/netomat/tomcat5.5.23 Using CATALINA_TMPDIR: /usr/local/netomat/tomcat5.5.23/temp Using JRE_HOME: /usr/jdk1.5.0_17 [r...@localhost tomcat]# ps -ef | grep tomcat root 3724 1 93 14:59 pts/000:00:05 /usr/jdk1.5.0_17/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/usr/local/netomat/tomcat5.5.23/conf/log ging.properties -Duser.timezone=America/New_York -server -Xms256M -Xmx1280M -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/local/netomat/tomcat5.5.23/common/endorsed -classpath :/usr/local/netomat/tomcat5.5.23/bin/bootstrap.jar:/usr/local/netomat/to mcat5.5.23/bin/commons-logging-api.jar -Dcatalina.base=/usr/local/netomat/tomcat5.5.23 -Dcatalina.home=/usr/local/netomat/tomcat5.5.23 -Djava.io.tmpdir=/usr/local/netomat/tomcat5.5.23/temp org.apache.catalina.startup.Bootstrap start root 3737 3675 0 15:00 pts/000:00:00 grep tomcat Paul Bourget Isabella Products -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, August 26, 2010 2:33 PM To: Tomcat Users List Subject: Re: java.net.BindException: Address already in use -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, On 8/26/2010 2:19 PM, Paul Bourget wrote: Thanks for looking at this. Wouldn't the first instance have open ports (indicated by netstat)? Or some httpd tasks (ps -ef). Yes, I would expect that. How are you launching Tomcat? I'm wondering if you're somehow launching Tomcat twice at once. Then again, one of them should succeed and the other should fail. Take the suggestions from others to modify your 'netstat' invocation to avoid showing service names instead of port numbers. Chuck has a good point: your server.xml looks like it's got some really old stuff in it. It's very possible that you've been dragging a server.xml from previous Tomcat versions around with you. Consider starting over with the server.xml that ships with Tomcat: just modify the shutdown port, AJP connector port, disable the HTTP connector, tweak the Host settings, and re-enable your AccessLogValve. It's unlikely to fix anything, but it will definitely clean things up. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkx2s08ACgkQ9CaO5/Lv0PBEpgCfTBKbtPqe2c+iDAOmoEaKLYJg RDYAn3KdPkwWWH+cQIqQMl/cn+B8Qfre =vFka -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: java.net.BindException: Address already in use
Server.xml inline below. There is also a server.working.xml Paul Bourget Isabella Products -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, August 26, 2010 4:25 AM To: Tomcat Users List Subject: Re: java.net.BindException: Address already in use On 25/08/2010 15:17, Paul Bourget wrote: I assumed that this indicates be a port conflict before I googled this problem. Every solution I found said find and resolve the port conflict. I cannot find the conflict. [r...@localhost logs]# netstat -a | grep 8209 [r...@localhost logs]# [r...@localhost logs]# netstat -a | grep 8606 [r...@localhost logs]# [r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat | catalina' root 3036 1 0 Aug24 ?00:00:00 Xvnc :5 -desktop localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth /root/.vnc/passwd -rfbport 5905 -pn Here's the log output Please make a backup of your server.xml. Remove all of the comments and any passwords from it. Post it (inline) here. ?xml version='1.0' encoding='utf-8'? Server debug=0 port=8606 shutdown=SHUTDOWN Service debug=0 name=Tomcat-Standalone !-- http connector, not used, using ajp connector -- !--Connector className=org.apache.catalina.connector.http.HttpConnector acceptCount=10 address=216.205.49.171 allowChunking=true bufferSize=2048 connectionTimeout=6 debug=1 enableLookups=true maxProcessors=75 minProcessors=5 port=8680 proxyPort=0 redirectPort=8643 scheme=http secure=false tcpNoDelay=true URIEncoding=UTF-8 Factory className=org.apache.catalina.net.DefaultServerSocketFactory/ /Connector-- Connector protocol=AJP/1.3 acceptCount=100 bufferSize=2048 connectionTimeout=5000 debug=0 disableUploadTimeout=false enableLookups=false maxProcessors=75 minProcessors=1 port=8209 proxyPort=0 redirectPort=8643 scheme=http secure=false tcpNoDelay=true useURIValidationHack=false useBodyEncodingForURI=true URIEncoding=UTF-8/Connector Engine debug=0 defaultHost=216.205.49.171 name=Catalina jvmRoute=netomat Host appBase=webapps autoDeploy=false debug=0 deployXML=false liveDeploy=true name=216.205.49.171 unpackWARs=false Valve className=org.apache.catalina.valves.AccessLogValve debug=1 directory=/log/tomcat/ pattern=%h %l %u %t quot;%rquot; %s %b prefix=216.205.49.171_access_log. resolveHosts=false rotatable=true suffix=.txt/ /Host Realm className=org.apache.catalina.realm.MemoryRealm debug=0 pathname=conf/tomcat-users.xml validate=true/ /Engine /Service /Server p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: java.net.BindException: Address already in use
Sorry, disregard the last email that file is from a different server (which is running fine). Here is the file from the server that is not working. Paul Bourget Isabella Products -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, August 26, 2010 4:25 AM To: Tomcat Users List Subject: Re: java.net.BindException: Address already in use On 25/08/2010 15:17, Paul Bourget wrote: I assumed that this indicates be a port conflict before I googled this problem. Every solution I found said find and resolve the port conflict. I cannot find the conflict. [r...@localhost logs]# netstat -a | grep 8209 [r...@localhost logs]# [r...@localhost logs]# netstat -a | grep 8606 [r...@localhost logs]# [r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat | catalina' root 3036 1 0 Aug24 ?00:00:00 Xvnc :5 -desktop localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth /root/.vnc/passwd -rfbport 5905 -pn Here's the log output Please make a backup of your server.xml. Remove all of the comments and any passwords from it. Post it (inline) here. ?xml version='1.0' encoding='utf-8'? Server debug=0 port=8606 shutdown=SHUTDOWN Service debug=0 name=Tomcat-Standalone Connector protocol=AJP/1.3 acceptCount=100 bufferSize=2048 connectionTimeout=5000 debug=0 disabl eUploadTimeout=false enableLookups=false maxProcessors=75 minProcessors=1 port=8209 proxyPort=0 red irectPort=8643 scheme=http secure=false tcpNoDelay=true useURIValidationHack=false useBodyEncodingFor URI=true URIEncoding=UTF-8/Connector Engine debug=0 defaultHost=192.168.30.19 name=Catalina jvmRoute=netomat Host appBase=webapps autoDeploy=false debug=0 deployXML=false liveDeploy=true name=192.168.30 .19 unpackWARs=false Valve className=org.apache.catalina.valves.AccessLogValve debug=0 directory=/log/tomcat/ pattern =%h %l %u %t quot;%rquot; %s %b prefix=192.168.30.19_access_log. resolveHosts=false rotatable=true su ffix=.txt/ /Host Realm className=org.apache.catalina.realm.MemoryRealm debug=0 pathname=conf/tomcat-users.xml valid ate=true/ /Engine /Service /Server p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: java.net.BindException: Address already in use
Hi Chris, Thanks for looking at this. Wouldn't the first instance have open ports (indicated by netstat)? Or some httpd tasks (ps -ef). Here is the beginning of the log file. If there are 2 tomcats running, one of them is not writing to the log (from what I can tell). [r...@localhost logs]# more catalina.2010-08-24.log Aug 24, 2010 1:51:16 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 570 ms Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardService start INFO: Starting service Tomcat-Standalone Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.23 Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init INFO: Port busy 8209 java.net.BindException: Address already in use Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8210 Aug 24, 2010 1:51:42 PM org.apache.jk.server.JkMain start INFO: Jk running ID=1 time=1/89 config=null Aug 24, 2010 1:51:42 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 25506 ms Aug 24, 2010 1:51:42 PM org.apache.catalina.core.StandardServer await SEVERE: StandardServer.await: create[8606]: java.net.BindException: Address already in use Paul Bourget Isabella Products -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, August 26, 2010 1:53 PM To: Tomcat Users List Subject: Re: java.net.BindException: Address already in use -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, On 8/26/2010 1:30 PM, Paul Bourget wrote: Sorry, disregard the last email that file is from a different server (which is running fine). Here is the file from the server that is not working. Your configuration looks fine to me: only one Connector and the shutdown port is distinct from that. The only thing I can think of is that you are starting that same Tomcat instance twice. Perhaps you have more than one Tomcat instance configured with the same ports? If you've added a network interface, is it possible that Tomcat is trying to bind to 0.0.0.0:8206 instead of 10.0.0.5:8206? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkx2qg4ACgkQ9CaO5/Lv0PCoHACdE/L4ccgNs0IoOnm+cdPi0Qei 23gAn3bpeCifaBMj/94IKP/hdvUi7HIt =9Ss0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
java.net.BindException: Address already in use
I assumed that this indicates be a port conflict before I googled this problem. Every solution I found said find and resolve the port conflict. I cannot find the conflict. [r...@localhost logs]# netstat -a | grep 8209 [r...@localhost logs]# [r...@localhost logs]# netstat -a | grep 8606 [r...@localhost logs]# [r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat | catalina' root 3036 1 0 Aug24 ?00:00:00 Xvnc :5 -desktop localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth /root/.vnc/passwd -rfbport 5905 -pn Here's the log output [r...@localhost logs]# more catalina.2010-08-24.log Aug 24, 2010 1:51:16 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 570 ms Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardService start INFO: Starting service Tomcat-Standalone Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.23 Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init ** INFO: Port busy 8209 java.net.BindException: Address already in use ** Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8210 Aug 24, 2010 1:51:42 PM org.apache.jk.server.JkMain start INFO: Jk running ID=1 time=1/89 config=null Aug 24, 2010 1:51:42 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 25506 ms ** Aug 24, 2010 1:51:42 PM org.apache.catalina.core.StandardServer await SEVERE: StandardServer.await: create[8606]: java.net.BindException: Address already in use 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:363) at org.apache.catalina.startup.Catalina.await(Catalina.java:616) at org.apache.catalina.startup.Catalina.start(Catalina.java:576) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) Aug 24, 2010 1:51:43 PM org.apache.catalina.core.StandardService stop INFO: Stopping service Tomcat-Standalone Aug 24, 2010 2:29:02 PM org.apache.catalina.connector.Connector pause SEVERE: Protocol handler pause failed java.net.SocketException: Network is unreachable at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:520) at java.net.Socket.connect(Socket.java:470) at java.net.Socket.init(Socket.java:367) Paul Bourget Director, Network Operations Isabella Products 9 Damonmill Square, Suite 4A Concord, MA 01742 978 287 0007 Ext 123
RE: java.net.BindException: Address already in use
I just started working with Tomcat so I don't know what script is used to start it other than Catalina.sh (the start section pasted below the command output). It used to work but stopped working recently. I did add a network interface and change the default gateway to point to the new interface. It is probably not related but, I also had a power outage. [r...@localhost logs]# netstat -an | grep 8209 [r...@localhost logs]# netstat -an | grep 8606 [r...@localhost conf]# grep 8209 server.xml Connector protocol=AJP/1.3 acceptCount=100 bufferSize=2048 connectionTimeout=5000 debug=0 disableUploadTimeout=false enableLookups=false maxProcessors=75 minProcessors=1 port=8209 proxyPort=0 redirectPort=8643 scheme=http secure=false tcpNoDelay=true useURIValidationHack=false useBodyEncodingForURI=true URIEncoding=UTF-8/Connector [r...@localhost conf]# grep 8606 server.xml Server debug=0 port=8606 shutdown=SHUTDOWN [r...@localhost conf]# dmesg | grep -i centos Linux version 2.6.18-164.10.1.el5 (mockbu...@builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Thu Jan 7 20:00:41 EST 2010 [r...@localhost bin]# ./catalina.sh version Using CATALINA_BASE: /usr/local/netomat/tomcat Using CATALINA_HOME: /usr/local/netomat/tomcat Using CATALINA_TMPDIR: /usr/local/netomat/tomcat/temp Using JRE_HOME: /usr/jdk1.5.0_17 Server version: Apache Tomcat/5.5.23 Server built: Mar 5 2007 08:25:04 Server number: 5.5.23.0 OS Name:Linux OS Version: 2.6.18-164.10.1.el5 Architecture: i386 JVM Version:1.5.0_17-b04 JVM Vendor: Sun Microsystems Inc. [r...@localhost bin]# **From Catalina.sh elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 if [ ! -z $CATALINA_PID ]; then echo $! $CATALINA_PID fi else $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 if [ ! -z $CATALINA_PID ]; then echo $! $CATALINA_PID fi fi ** end of snippet Paul Bourget Isabella Products -Original Message- From: peter.crowth...@googlemail.com [mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther Sent: Wednesday, August 25, 2010 10:26 AM To: Tomcat Users List Subject: Re: java.net.BindException: Address already in use Well, the ports you're requesting are or have recently been in use. Try: netstat -an | grep 8209 ... just in case someone's given the service a name in /etc/services. Also just check that you've not got the same number in two places in conf/server.xml, for example as the shutdown port. Finally, check none of your scripts are trying to start two instances of the same Tomcat at the same time - it has happened! If it's none of those, come back to us. If you could give us details about your environment (OS version, Tomcat version, Java version) we'd be more likely to give help that's specific to you. I can see Tomcat 5.5.23 in the logs (why so old, by the way?) but have no idea about the others. Finally, what's that Socks socket doing at shutdown? - Peter On 25 August 2010 15:17, Paul Bourget paul.bour...@isabellaproducts.comwrote: I assumed that this indicates be a port conflict before I googled this problem. Every solution I found said find and resolve the port conflict. I cannot find the conflict. [r...@localhost logs]# netstat -a | grep 8209 [r...@localhost logs]# [r...@localhost logs]# netstat -a | grep 8606 [r...@localhost logs]# [r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat | catalina' root 3036 1 0 Aug24 ?00:00:00 Xvnc :5 -desktop localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth /root/.vnc/passwd -rfbport 5905 -pn Here's the log output [r...@localhost logs]# more catalina.2010-08-24.log Aug 24, 2010 1:51:16 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 570 ms Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardService start INFO: Starting service Tomcat-Standalone Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.23 Aug 24