Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.net.BindException: Address already in use: JVM_Bind <null>:80

I am getting binding exception while starting the Tomcat server. I tried to kill the process that which is using '80' as couple of processes are using it.

Getting error, while killing process id is '0':

ERROR: The process with PID 0 could not be terminated. Reason: This is critical system process. Taskkill cannot end this process.

How to fix this?

I don't need to use another port to run the tomcat server.

like image 776
iamjustcoder Avatar asked Sep 09 '14 10:09

iamjustcoder


People also ask

What is Java net BindException address already in use?

BindException: Address already in use: JVM_Bind is a common exception in Java with applications trying to connect on a particular port and some other processes either Java or non Java is already connected on that port.

What is Java net BindException?

Signals that an error occurred while attempting to bind a socket to a local address and port. Typically, the port is in use, or the requested local address could not be assigned.

What could be the reason of following exception while communicating with tomcat java net BindException Address already in use JVM_Bind 8080?

BindException: Address already in use: JVM_Bind, mean that, the ports defined in Tomcat server. xml file are already in use. They could be used by another application / program or simply, the Tomcat service was not previously terminated properly.


2 Answers

PID 0 is the System Idle Process, which is surely not listening to port 80. How did you check which process was using the port?

You can use

netstat /nao | findstr "80"

to find the PID and check what process it is.

like image 59
csaba.sulyok Avatar answered Oct 10 '22 06:10

csaba.sulyok


Setting Tomcat to listen to port 80 is WRONG , for development the 8080 is a good port to use. For production use, just set up an apache that shall forward your requests to your tomcat. Here is a how to.

like image 45
George Papatheodorou Avatar answered Oct 10 '22 06:10

George Papatheodorou