Another Common tomcat server error is “Port 8080 required by Tomcat v9.0 at localhost is already in use” or “Several ports (8080, 8080, 8009) required by Tomcat v8.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s)”
If you stuck to deploy your Java web application over the tomcat and getting the error “Post XXXX is already in the used” then in this tutorial you will get the complete solution to solve this problem. Directly dive into the solution just understand the root cause of the error.
Port 8080 required by Tomcat v9.0 at localhost is already in use
When we run or server it must require an IP address and the port number. So for the port number, it always searches for the configured port number in the config file. but let’s take an example any other application is also using the same port number and it’s in running condition and tomcat is also trying to use the same port number. Due to this tomcat throws the error “Port 8080 required by Tomcat v9.0 at localhost is already in use”.
Now, Logically we have two solutions for this problem. let’s see both one by one.
- Change the port number for tomcat from the config file.
- We can kill that other process that is using the same port number.
How to change Port number of Tomcat Server
- Find your tomcat server in the ide (Eclipse, STS or netbeans) by following this path Windows==> Show View ==> Other==>Server.
- Now double click on the server.
- Change the port number manually.
- Save the file and restart the server.
Kill other application that is running on same port number
It’s really simple to kill any process from the task manager of the windows machine. but to kill the process or identify that process we must need to know the PID (Process Id). So now follow the below commands to get it.
Step1) Open your CMD and run the below command.
netstat -ano | findstr <Port Number>
netstat -ano | findstr 8080
Step2) Find process id by the above command and enter the below command to kill it.
taskkill /F /PID < Process Id >
taskkill /F /PID <13020>