1/15/2007

Tomcat startup failed: Address already in use: JVM_Bind

Tomcat failed to startup with the following error in %CATALINA_HOME%\logs\catalina.2007-01-11.log:

Jan 11, 2007 8:59:33 AM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[8005]:
java.net.BindException: Address already in use: JVM_Bind
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)
It appears the port number 8005, where tomcat is listening for SHUTDOWN signal, is already used by another process. It's a little bit odd, since I just started Windows and ran Tomcat as the first command.

I suspected it was some windows service program that automatically started when windows is started. It turned out to be some apple software is running on port 8005. After I removed that apple software, I was able to run Tomcat using the default port number 8005. This site lists port numbers used by some apple software.

Alternatively, I could just change Tomcat to use another port number by editing %CATALINA_HOME%\conf\server.xml:
<Server port="8006" shutdown="SHUTDOWN">

47 comments:

alr said...

TCPView from Sysinternals is a handy Windows tool for determining what process is holding on to your ports. Very handy for tracking down this sort of thing.

http://www.microsoft.com/technet/sysinternals/Networking/TcpView.mspx

S,
ALR

jstudent said...

Thanks for for the suggestion. I found using netstat -abv command also gives you a detailed list of which program is using which port. Note: this command takes a long time.

SOBIYA said...

hi alr tks i too had the same prob.using this microsoft link i found ports n disconnected thier service. Tomcat works well now

Anonymous said...

After hours of searching for why my tomcat service kept shutting down I decided to run it via console. I receive a JVM_Bind error message and your message lead me to the solution of changing the shutdown port. Seriously, thank you.

Eduardo Martos Gómez said...

Thank you very much! I was going mad :).

Luis Caballero said...

Thank you ALR, for sharing your comment.

Anonymous said...

This problem bothers a lot and these posts are very helpful.
Thanks to all.

Anonymous said...

Thank You

Arvind said...

This is really helpful when you want to run more than one instance of tomcat in single server

Anonymous said...

Rakesh 1401: When tomcat is not shutdowned properly, then also this error comes.
Simply close you IDE, check for any javaw instances in TaskManager, 'End Task' them and restart the IDE and server.

Anonymous said...

FYI - if you install the new VMware server software, which is now web based, it includes a Tomcat server internally and you'll run into the problem posted here with a normal tomcat installation.

Anonymous said...

Hi, I am trying to run both TOMCAT 5.5 and TOMCAT 6 on my machine.

I am keeping the configurations of TOMCAT 5.5 as it is and changing the port number on tomcat 6, in the SERVER.XML file.

I tried giving many ports but it still fails for

Dec 8, 2008 5:52:15 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[2008]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)



CAN anyone help me out??

javahowto said...

Did you change all the port numbers in server.xml? You need to at least change the http connector port and shutdown signal port. If ssl/tls is supported, also the https port. I vaguely recall there is a way to set a base number for all required port numbers so you only need to change this base number. But I couldn't find out.

javahowto said...

The different groups of port numbers I referred to in previous comment is a JBoss feature, not Tomcat.

Anonymous said...

Thanks I had the same issue. Solved it by changing the port :)

Anonymous said...

Changing the port worked for me. Thank you so much!

Anonymous said...

Thank you very much. After two days of troubles I changed the port number as you suggested and all is working now. :)
Thank you again.
Ale

Osama Salah said...

Thanks all, thank you alr, it really is a handy tool. Now Tomcat works.

tejas said...

Thanks you so much for the info. This solved my problem.

sameer said...

Thanks for ur suggestion .I had totally
confused that my tomcat server was not run
thanks yaar

sameer

Ally said...

Thanks for your suggestion, It worked for me after changing the shutdown port to some other.

Ally

William said...

This information was a huge help. the netstat -abv told me which application was using port 8005. As soon as I figured that out I changed the port in my tomcat server.xml file to 8006 and it worked like a charm.

Sujie said...

Thanks for your handy tip..It worked like charm..thanks for taking time to share your experience with everybody

MANIK said...

Thanks a lot u save my job

Anonymous said...

My port is not busy. I tried other numbers for shutdown, but all of the have the same problem.

Anonymous said...

I had a problem with this issue. I used netstat but shutdown port was not busy. I changed the port number to other numbers but problem still existed.

You what was the problem?

Once I had defined an IP in my hosts file and related it to my localhost.
I deleted this and the problem was solved.

Anonymous said...

Thanks.. I too solved it by changing the port number :)

Anonymous said...

Thanks, this helped me resolve a similar issue. Two products Intellicus and Unity were both using the same shutdown port!

Javin Paul said...

This is quite a common error and I have faced many times, it occurs in the event of port conflict if two process try to use same port. even with the eclipse remote debugging you can get this error if some process already listening and your try to remotely connect eclipse on that port.

Javin
How to setup java remote debugging in Eclipse

Anonymous said...

Thank you

Thiago said...

I had the same problem on windows.
I uncommented the line "127.0.0.1 localhost" of hosts file.
It is working now.

Thiago said...
This comment has been removed by the author.
a2ztechguide.com said...

Refer below link to get solution of this problem.

http://www.a2ztechguide.com/2011/09/tomcat-startup-failed-address-already.html

ahyan said...

Many Thanks! ^__^

Darshit said...

I had the same tomcat error.
Changing shutdown port number works for me!
Thanks A Lot!

M@M@'s B@c| said...

I had the same tomcat error.
Changing shutdown port number works for me!
Thanks A Lot!

Anonymous said...

grt post... Thanks! New URL from MS site is http://technet.microsoft.com/en-us/sysinternals/bb897437

Anonymous said...

Thank you so much!!I was having problems starting my server and you helped me a lot.

孙大作 said...

I got the same problem
i run netstat -na -f inet but there is no program holding the port 8005

and i changed the port 8006,it doesn't work

Cookie #3 said...

adb - android thingymajic was my culprit. just killed the process

Anonymous said...

use below command to release service from specific port :

windows:-

netstat -ano | find "port no"
killtask /F /PID "pid number"

Linux :-

netstat -ano | grep "port no"
kill "pid number"

Anonymous said...

If you want to use the same port execute 'netstat --tcp --udp --listening --program' as root user. other wise you it won't give PID/Program Name

then use kill -9 PID command

then edit 'SHUTDOWN' port in server.xml file

Anonymous said...

Thank you very much....
Changing port no is working....

Vani said...

Thank you so much.....

Anonymous said...

close your IDE or restart your System...

Anonymous said...

Thanks for the post. It helped me

NanamiChan said...

Thank you so much.