9

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.

kenorb
  • 155,785
  • 88
  • 678
  • 743
iamjustcoder
  • 4,714
  • 10
  • 33
  • 46

14 Answers14

11

The error:

java.net.BindException: Address already in use: JVM_Bind :80

means that another application is listening on port 80.

You can check which process is using this port by lsof command, e.g. sudo lsof -i:80. Then stop or kill it.

If won't help finding application running on the same port, the common mistake is the Tomcat misconfiguration.

For example by default Tomcat listens on port 8005 for SHUTDOWN command and if you set another Connector to listen on the same port, you'll get port conflict.

So please double check in server.xml whether these ports are different:

<Server port="8005" shutdown="SHUTDOWN">
    <Connector port="8983" protocol="HTTP/1.1"
kenorb
  • 155,785
  • 88
  • 678
  • 743
8

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.

George Papatheodorou
  • 1,539
  • 19
  • 23
5

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.

csaba.sulyok
  • 1,880
  • 2
  • 13
  • 13
3

Use the following command to find if your tomcat port is already in use,

netstat -a -b

netstat -a -o | findstr :port

For example

netstat -a -o | findstr :8080

Exception: java.net.BindException: Address already in use: JVM_Bind:80

means that port 80 is configured by your Tomcat server and it is already used by some other application running on your computer. Please quit Skype if open or change the default port in Skype or other application's port to something other than 80. Or change the tomcat port to something else than 80(e.g. 8080 or 9090) in the server.xml file under the config folder of your tomcat installation directory.

Exception: java.net.BindException: Address already in use: JVM_Bind

means you din't stop the tomcat server properly and you are trying to start the server again. In Eclipse, the solution for me was to remove the project from the servers tab and right click and run the project as Run on server. This added the project back to the Tomcat 7 and I din't get the BindException error. This was due to closing eclipse the last time you used without stopping the Tomcat server.

Lucky
  • 16,787
  • 19
  • 117
  • 151
  • Both works for me. It basically tells you the port which is in use already. So that it will be listed in the prompt. – Lucky Aug 14 '19 at 14:00
2

I do a goofy mistake and It take me 2 hour to solve It.I mentioned it here for other persons may be help them.The mistake was I enable ssl connector and changed both https and http ports to same number .

ali
  • 1,082
  • 1
  • 11
  • 17
0

If you have some process listening on port 8080 then you can always configure tomcat to listen on a different port. To change the listener port by editing your server.xml located under tomcat server conf directory.

Search for Connector port="8080" in server.xml and change the port number to some other port.

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136
0

The error:

Tomcat: java.net.BindException: Address already in use: JVM_Bind :80

suggests that the port 80 is already in use.
You may either:

  • Try searching for that process and stop it OR
  • Make your tomcat to run on different (free) port

See also: Deployment error:Starting of Tomcat failed, the server port 8080 is already in use

Community
  • 1
  • 1
S1LENT WARRIOR
  • 11,704
  • 4
  • 46
  • 60
0

I deleted my server and added it back. IT happened because I shut down the eclipse manually via task manager and it did not shut down the tomcat.

0

C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\conf

Your Port ID in Server.xml File in Source folder is 8080. change the Port Number to 8081...etc

selvan
  • 1
0

I faced this problem while working in a spring project with tomcat:

Address already in use: JVM_Bind

screenshot of bin folder

To resolve the issue I ran a shutdown.bat file in tomcat/bin folder.

Bucket
  • 7,415
  • 9
  • 35
  • 45
mahesh Y
  • 11
  • 2
0

I completely forgot that I had previously installed another version of Apache Tomcat, which was causing this problem. So, just try uninstalling the previous version. Hope it helps.

Yash P Shah
  • 779
  • 11
  • 15
0

Make sure /webapps/ROOT file is there and it has all the icons, WEB-INF, and index.jsp is in the folder.

When you startup Tomcat, it will run this code in <Tomcat-Directory>/conf/web.xml directory:

<welcome-file-list>
   <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

The location of index.jsp is in <Tomcat-Directory>/webapps/ROOT/index.jsp

Also, try running tomcat from the /bin directory using ./catalina.sh start instead of ./startup.sh. For some reason, ./startup.sh isn't as reliable.

Gene
  • 10,819
  • 1
  • 66
  • 58
0

I came across same issue. I was getting error Unable to open debugger port (127.0.0.1:63936): java.net.BindException "Address already in use: JVM_Bind" I tried above all option but any how its not resolved. Solution which worked for me is, I started the server and then stopped and again started in debug mode. then the server got started in debug mode.

ganesh phirke
  • 471
  • 1
  • 3
  • 12
0

It is possible, like in my case, that a Windows update could cause this issue.

As pointed out in another answer, tomcat listens for the SHUTDOWN command on port 8005 by default. A Windows update caused this port to be reserved by a vital Windows process that was not appearing when I searched for running processes on port 8005 through the command prompt.

To fix this, I simply needed to change the port in my server.xml:

<Server port="8006" shutdown="SHUTDOWN">