简体   繁体   中英

Port 8080 already in use in eclipse

I am trying to run a Spring MVC demo file on Eclipse oxygen when I hit the button run as> run on server it shows the following error after a moment

Port 8080 required by Tomcat v8.5 Server at localhost is 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)

Step 1: (open the CMD command)

  C:\Users\username>netstat -o -n -a | findstr 0.0:8080

  TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 3116

  Now , we can see that LISTENING port is 3116 for 8080 ,

  We need to kill 3116 now

Step 2:-

 C:\Users\username>taskkill /F /PID 3116

 Step 3: Go to Eclipse and start Server , it will run

OR

 you can change port number in folder  servers>Tomcat>server.xml

A process is already listening on port 8080 and you can't have more than one process listening on the same port.

You have two options :

  1. Kill the existing process if it's not usefull netstat -tulpn | grep :8080 netstat -tulpn | grep :8080

  2. Change you application port. In your application.properties and file add this line server.port=8081

in your apache conf folder, open the httpd file and look for 8080 port. Change 8080 to any port you like. I believe you will find 8080 on two places

如果windows,请从任务管理器中杀死java进程,否则如果linux系统kill -9 tomcat

如果问题仍然存在,您可以更改 Tomcat 服务器的默认端口。

Always Kill the process before deploying your war file in tomcat

ps -A|grep tomcat It will list all tomcat process. Note Down the PID and run

KILL <PID>

Cross check by ps -A|grep tomcat

I face the same problem and after searching the answer as shown below: 1. open Monitor Tomcat as shown below:

在此处输入图片说明

  1. Simply press stop as shown in below picture:

在此处输入图片说明

Finally it works with me after many trials and suggested solutions.

Best Regards, Kerelos Mikhail

My method is to run tomcat7w.exe to disable it. (Only Stopping it is not enough). And my Kaspersky (Anti virus) generate some new rules for eclipse and java.

Followed below steps and was able to solve the issue:

C:\\Users\\Sri Priya P Kulkarni>netstat -o -n -a | findstr 0.0:8080 TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 13196

C:\\Users\\Sri Priya P Kulkarni>taskkill /F /PID 13196 SUCCESS: The process with PID 13196 has been terminated.

你可以进入服务器 > server.xml .in server.xml 文件你应该改变,步骤 1) 步骤 2) 步骤 3) < Connector port="8010" protocol="AJP/1.3" redirectPort="8443"/>并保存更改。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM