Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java.net.BindException: The socket name is already in use.

Status
Not open for further replies.

qaz123

IS-IT--Management
Jul 30, 2001
8
Hi everyone,

I just did a fresh installation of Jakarta 4.0.3 and Jakarta 4.0.4 and when i try to start Tomcat, i get the same message on both version, which is:

java.net.BindException: The socket name is already in use.

With the following, can anyone tell me how to solve this problem.

Thank you in advance,

qaz123

=================================================
Computer setup:

Computer: IBM 7044 170 RS6000
OS: AIX 4.3.3 Maint Level: 10
JDK: IBM Version 1.3.1

= = = = = = = = = = = = = = = = = = = = = = = = =
Command used to start Tomcat


wbmaster@ibm44p(/db04/tomcat_404/bin)# ps -ef | grep java
wbmaster 20142 18556 0 16:10:13 pts/1 0:00 grep java

wbmaster@ibm44p(/db04/tomcat_404/bin)# grep 8080 /etc/services
# java_wbsrv 8080/tcp # Java Web Server
# java_wbsrv 8080/udp # Java Web Server

wbmaster@ibm44p(/db04/tomcat_404/bin)# grep 8007 /etc/services
# javahndl 8007/tcp # Java Connection Handler
# javahndl 8007/udp # Java Connection Handler

wbmaster@ibm44p(/db04/tomcat_404/bin)# netstat -a | grep 8080

wbmaster@ibm44p(/db04/tomcat_404/bin)# netstat -a | grep 8007

wbmaster@ibm44p(/db04/tomcat_404/bin)# startup.sh
Using CATALINA_BASE: /db04/tomcat_404
Using CATALINA_HOME: /db04/tomcat_404
Using CATALINA_TMPDIR: /db04/tomcat_404/temp
Using JAVA_HOME: /usr/java131

wbmaster@ibm44p(/db04/tomcat_404/bin)# cd ../logs

wbmaster@ibm44p(/db04/tomcat_404/logs)# ls -l
total 32
-rw-r--r-- 1 wbmaster wbmaster 2164 Aug 08 16:11 catalina.out
-rw-r--r-- 1 wbmaster wbmaster 725 Aug 08 16:11 catalina_log.2002-08-08.tx
t
-rw-r--r-- 1 wbmaster wbmaster 0 Aug 08 16:11 localhost_access_log.2002-
08-08.txt
-rw-r--r-- 1 wbmaster wbmaster 1150 Aug 08 16:11 localhost_examples_log.200
2-08-08.txt
-rw-r--r-- 1 wbmaster wbmaster 3372 Aug 08 16:11 localhost_log.2002-08-08.t
xt

wbmaster@ibm44p(/db04/tomcat_404/logs)# cat catalina.out
Starting service Tomcat-Standalone
Apache Tomcat/4.0.4
java.net.BindException: The socket name is already in use.
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:430)
at java.net.ServerSocket.<init>(ServerSocket.java:191)
at java.net.ServerSocket.<init>(ServerSocket.java:142)
at org.apache.catalina.net.DefaultServerSocketFactory.createSocket(Defau
ltServerSocketFactory.java:118)
at org.apache.ajp.tomcat4.Ajp13Connector.open(Ajp13Connector.java:797)
at org.apache.ajp.tomcat4.Ajp13Connector.start(Ajp13Connector.java:1013)
at org.apache.catalina.core.StandardService.start(StandardService.java:3
95)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
java.lang.NullPointerException
at org.apache.ajp.tomcat4.Ajp13Connector.run(Ajp13Connector.java:841)
at java.lang.Thread.run(Thread.java:512)
java.lang.IllegalThreadStateException
at java.lang.ThreadGroup.add(ThreadGroup.java:814)
at java.lang.Thread.init(Thread.java:307)
at java.lang.Thread.<init>(Thread.java:477)
at org.apache.ajp.tomcat4.Ajp13Processor.threadStart(Ajp13Processor.java
:576)
at org.apache.ajp.tomcat4.Ajp13Processor.start(Ajp13Processor.java:666)
at org.apache.ajp.tomcat4.Ajp13Connector.newProcessor(Ajp13Connector.jav
a:769)
at org.apache.ajp.tomcat4.Ajp13Connector.start(Ajp13Connector.java:1025)
at org.apache.catalina.core.StandardService.start(StandardService.java:3
95)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

wbmaster@ibm44p(/db04/tomcat_404/logs)#

 
It looks like there is already an application running that has bound port 8080. Is this a shared machine? If so, someone may already be running tomcat on this port. Try changing the port to 8081 or something like that and try restarting.
 
Hi meadandle,

Thank you for your response.

I am runnig Tomcat on a test machine and it is a stadalone installation.

Also, I did not modify anything in the connfiguration files.

As you can see in my test, the &quot;netstat -a&quot; did not produce anything. I also used the &quot;lsof&quot; program to verify if there was something on port 8080 and on port 8007. Nothing was reported.

Any other ideas?

Thank you

qaz123
 
Hi,

I finally found the culprit on my problem. On AIX, when we install the HTTPServer application from IBM, this one have the &quot;admin&quot; section which listen on port 8008 by default. Also, we had to change the default Web Server port from 80 to 8009 because we are using a different Web Server program.


- How I solve this problem

1_ I looked at all the ports used in the configurations files.

2_ I issue the this command: netstat -na | grep -i listen

3_ I found that port 8009 was used

4_ I changed the port for the HTTP Server and everything work fine.

I am on the next step now,

Thank you

qaz123
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top