Address localhost 8080 is already in use как исправить
Trying to start Tomcat service this fails and logs shows:
SEVERE: Failed to initialize end point associated with ProtocolHandler [«http-bio-8080»]
java.net.BindException: Address already in use: JVM_Bind :8080
Environment
SDM 14.1.X and higher
CABI 4.X SP1/SP3/SP5
Cause
As the error suggest there is already another server running on the same port (in this case 8080) . You can either kill that service or change your web server to run on another port.
Resolution
1. How to kill the previous service
If you have decided to kill the previous service, then you just have to find the process in which your service is running and simply kill that process.
Below are the commands to find the process and kill it.
Windows Environment
In windows, netstat is used to display protocol statistics and current TCP/IP network connections.
- Find the process which is using the port number. (See the below example where the process number is 6324).
- Then use taskkill command to forcefully terminate that process.
-
- netstat -ano | find «8080»
- taskkill /F /PID 6324
Linux
Similarly, in Linux you can use netstat command to find the process.
- In Linux, netstat is used to show network status
- Grep command is used to find the particular port out of it as shown below.
- Then use the kill command to terminate the process.
-
- netstat -an | grep «8080»
- kill — 6324
2. How to change the web server to run on another port
Tomcat
If you are using tomcat, locate the file server.xml (E.g. C:/apache-tomcat-7.0.11/conf/server.xml). You will see below code snippet.
connectionTimeout=»20000″
redirectPort=»8443″ />- Change the above port number (E.g. 8080 ) to any other port number.
- Now your web server will run on the new port which you have provided.
Additional Information
The port showed in the logs is being used in the server by another process. The process can be:
1) Another tomcat deployment like REST, Federated Search, Visualizer
2) Another Application deployment using the same port. Example: CABI, Service Catalog, Process Automation, etc.
3) The same application that is already running. A ghost javaw.exe process from the same application that is still running and must be killed before start the process again.
4) A problematic Windows update has been installed in the server where SDM is installed. The following patches from July 2018 cause this issue to occur: For Windows 2012 KB4284878 and KB4338815. For Windows 2008 KB4338818 and KB4338823Review the server.xml for each tomcat installation by following the steps below:
1) Go to the server where Service Desk is installed2) Go to NX_ROOT\bopcfg\www . Each CATALINA_BASE folder is a different tomcat installation.
CATALINA_BASE is for Service Desk
CATALINA_BASE_REST is for REST Services
CATALINA_BASE_SA is for Support Automation
CATALINA_BASE_VIZ is for Visualizer
CATALINA_BASE_FS is for Federated Search3) Review each server.xml file under conf folder for each tomcat deployment and ensure the port number being used are different for each deployment.
You need to pay attention to the uncommented tags like:4) Run pdm_configure to assign the right ports to each deployment
5) Start SDM Services
For Cause 2 and 3:
1) Go to the server where you are getting the issue
2) Open a Command Prompt Window and run: netstat -ano | findstr «Port Number» (Example: netstat -ano | findstr «8080»)
The command above will list at least one row with the 8080 port number
3) Go to task manager and locate the process that is running and using the same port number (example: javaw.exe) and kill if necessary. If it’s another application, then you would need to configure the other applications to use another port number to avoid port conflicts again1) To solve issue in Windows 2008: Install August 2018 Windows patches: KB4343900 + KB4343899
2) To solve issue in Windows 2012: Install August 2018 Windows patches: KB4343898 + KB4343888Additionally, please examine
Address localhost 8080 is already in use как исправить
Господа! Вот возникает данная ошибка при запуске томката из-под идеи.
Причем если запускать отдельно томкат, то все работает отлично. На работе у меня (с тем же томкатом, идеей и web-проектом) тоже отлично работает.
Перепробовал все. В выводе команды «netstat -na» нет порта 8080. Хотя «telnet localhost 8080» коннектиться. Но при попытке что-нибудь написать в окне телнета. Коннекшн сразу сбрасывается. Вобщем, я так и не могу понять кто у меня висит на этом порту.
Смена порта в server.xml также не решает проблемы. Хотя где-то неделю-две назад у меня была такая же ошибка. Я тогда сменил порт на 6060 и все стало работать. А недавно снова эта ошибка стала возникать.
ОС — Win XP SP2, idea 7.0.4 (хотя пробовал и с 7.0.3), tomcat — 6.0.16 (хотя пробовал и с 6.0.18).Re: Address localhost:8080 is already in use
От: Аноним Дата: 21.08.08 17:42 Оценка: Здравствуйте, tipoc, Вы писали:
T>Господа! Вот возникает данная ошибка при запуске томката из-под идеи.
T>Причем если запускать отдельно томкат, то все работает отлично. На работе у меня (с тем же томкатом, идеей и web-проектом) тоже отлично работает.
T>Перепробовал все. В выводе команды «netstat -na» нет порта 8080. Хотя «telnet localhost 8080» коннектиться. Но при попытке что-нибудь написать в окне телнета. Коннекшн сразу сбрасывается. Вобщем, я так и не могу понять кто у меня висит на этом порту.
T>Смена порта в server.xml также не решает проблемы. Хотя где-то неделю-две назад у меня была такая же ошибка. Я тогда сменил порт на 6060 и все стало работать. А недавно снова эта ошибка стала возникать.
T>ОС — Win XP SP2, idea 7.0.4 (хотя пробовал и с 7.0.3), tomcat — 6.0.16 (хотя пробовал и с 6.0.18).У меня такая же проблема была, когда был включен касперский.
Re: Address localhost:8080 is already in use
От: Protey Дата: 21.08.08 17:51 Оценка: Ммм. Поищите в списке процессов больше одного java Томкат периодически не полностью выгружается.
Re[2]: Address localhost:8080 is already in useОт: tipoc Дата: 21.08.08 17:53 Оценка: Здравствуйте, Protey, Вы писали:
P>Ммм. Поищите в списке процессов больше одного java Томкат периодически не полностью выгружается.
Это я уже пробовал С этим все нормально.
Re[2]: Address localhost:8080 is already in use
От: tipoc Дата: 21.08.08 17:58 Оценка: Здравствуйте, Аноним, Вы писали:
А>Здравствуйте, tipoc, Вы писали:
T>>Господа! Вот возникает данная ошибка при запуске томката из-под идеи.
T>>Причем если запускать отдельно томкат, то все работает отлично. На работе у меня (с тем же томкатом, идеей и web-проектом) тоже отлично работает.
T>>Перепробовал все. В выводе команды «netstat -na» нет порта 8080. Хотя «telnet localhost 8080» коннектиться. Но при попытке что-нибудь написать в окне телнета. Коннекшн сразу сбрасывается. Вобщем, я так и не могу понять кто у меня висит на этом порту.
T>>Смена порта в server.xml также не решает проблемы. Хотя где-то неделю-две назад у меня была такая же ошибка. Я тогда сменил порт на 6060 и все стало работать. А недавно снова эта ошибка стала возникать.
T>>ОС — Win XP SP2, idea 7.0.4 (хотя пробовал и с 7.0.3), tomcat — 6.0.16 (хотя пробовал и с 6.0.18).А>У меня такая же проблема была, когда был включен касперский.
У меня eset nod32 (на работе symantec antivirus). Я гуглил в инете и в самом деле у многих возникает такая проблема из-за касперского.
У себя я отрубал nod32, но все по-прежнему.
Кстати, в списке виндовых сервисов есть сервисы ESET HTTP Server (у него стоит manual и он остановлен) и Eset Service (он всегда работает, я даже не могу его остановить).Re[3]: Address localhost:8080 is already in use
От: KRA Дата: 21.08.08 19:26 Оценка: Здравствуйте, tipoc, Вы писали:
T>У меня eset nod32 (на работе symantec antivirus). Я гуглил в инете и в самом деле у многих возникает такая проблема из-за касперского.
T>У себя я отрубал nod32, но все по-прежнему.
T>Кстати, в списке виндовых сервисов есть сервисы ESET HTTP Server (у него стоит manual и он остановлен) и Eset Service (он всегда работает, я даже не могу его остановить).Виноват нод. Отключение не помогает (не знаю почему, но он продолжает блокировать), но можно настроить его, чтоб не блокировал. Смотри в опциях, что-то типа «проверка http трафика», там есть несколько вариантов как бороть. Если нужны подробности, завтра на работе посмотрю как у себя настроил.
Re[4]: Address localhost:8080 is already in use
От: tipoc Дата: 21.08.08 20:27 Оценка: 1 (1) Здравствуйте, KRA, Вы писали:
KRA>Здравствуйте, tipoc, Вы писали:
T>>У меня eset nod32 (на работе symantec antivirus). Я гуглил в инете и в самом деле у многих возникает такая проблема из-за касперского.
T>>У себя я отрубал nod32, но все по-прежнему.
T>>Кстати, в списке виндовых сервисов есть сервисы ESET HTTP Server (у него стоит manual и он остановлен) и Eset Service (он всегда работает, я даже не могу его остановить).KRA>Виноват нод. Отключение не помогает (не знаю почему, но он продолжает блокировать), но можно настроить его, чтоб не блокировал. Смотри в опциях, что-то типа «проверка http трафика», там есть несколько вариантов как бороть. Если нужны подробности, завтра на работе посмотрю как у себя настроил.
Вобщем. Решил я проблему В настройках http фильтра во вкладке «веб-браузеры» отключил пункты «C:\Program Files\Java\jdk1.6.0_02\bin\java.exe» и «C:\Program Files\JetBrains\IntelliJ IDEA 7.0.4\bin\idea.exe». И все заработало! Спасибо большое!
Re[5]: Address localhost:8080 is already in use
От: Donz http://donz-ru.livejournal.com Дата: 22.08.08 10:00 Оценка: Здравствуйте, tipoc, Вы писали:
T>Вобщем. Решил я проблему В настройках http фильтра во вкладке «веб-браузеры» отключил пункты «C:\Program Files\Java\jdk1.6.0_02\bin\java.exe» и «C:\Program Files\JetBrains\IntelliJ IDEA 7.0.4\bin\idea.exe». И все заработало! Спасибо большое!
Здаров.
Спасибо за еще один довод никогда не ставить эти автоматизированные системы защиты непонятного кого от окружающей среды.
Жесть какая-то.
Оффтоп, но за последние лет семь из всех программных средств защиты пользуюсь исключительно сканером вирусов (ClamWin или Avast, например, оба бесплатны). Фаервол обычно железный, а все, что загружаю из интернета прогоняю через сканер. Никаких проблем: туча автоматических проверялок не засоряют память, диск и не мешают работе остальных программ.Re: Address localhost:8080 is already in use
От: Аноним Дата: 23.02.09 10:25 Оценка: Здравствуйте, tipoc, Вы писали:
T>Господа! Вот возникает данная ошибка при запуске томката из-под идеи.
T>Причем если запускать отдельно томкат, то все работает отлично. На работе у меня (с тем же томкатом, идеей и web-проектом) тоже отлично работает.
T>Перепробовал все. В выводе команды «netstat -na» нет порта 8080. Хотя «telnet localhost 8080» коннектиться. Но при попытке что-нибудь написать в окне телнета. Коннекшн сразу сбрасывается. Вобщем, я так и не могу понять кто у меня висит на этом порту.
T>Смена порта в server.xml также не решает проблемы. Хотя где-то неделю-две назад у меня была такая же ошибка. Я тогда сменил порт на 6060 и все стало работать. А недавно снова эта ошибка стала возникать.
T>ОС — Win XP SP2, idea 7.0.4 (хотя пробовал и с 7.0.3), tomcat — 6.0.16 (хотя пробовал и с 6.0.18).Проблема с антивирусом скорее всего. Настройте исключение для локалхоста и все должно заработать. В качестве теста попробуйте сначала отключить антивирус и запустить томкат из идеи
Re: Address localhost:8080 is already in use
От: Passer Дата: 23.02.09 11:26 Оценка: Здравствуйте, tipoc, Вы писали:
T>Господа! Вот возникает данная ошибка при запуске томката из-под идеи.
вот чисто для интереса. что выдает «telnet localhost 8080»?
Re[2]: Address localhost:8080 is already in use
От: tipoc Дата: 23.02.09 11:37 Оценка: Здравствуйте, Аноним, Вы писали:
А>Здравствуйте, tipoc, Вы писали:
T>>Господа! Вот возникает данная ошибка при запуске томката из-под идеи.
T>>Причем если запускать отдельно томкат, то все работает отлично. На работе у меня (с тем же томкатом, идеей и web-проектом) тоже отлично работает.
T>>Перепробовал все. В выводе команды «netstat -na» нет порта 8080. Хотя «telnet localhost 8080» коннектиться. Но при попытке что-нибудь написать в окне телнета. Коннекшн сразу сбрасывается. Вобщем, я так и не могу понять кто у меня висит на этом порту.
T>>Смена порта в server.xml также не решает проблемы. Хотя где-то неделю-две назад у меня была такая же ошибка. Я тогда сменил порт на 6060 и все стало работать. А недавно снова эта ошибка стала возникать.
T>>ОС — Win XP SP2, idea 7.0.4 (хотя пробовал и с 7.0.3), tomcat — 6.0.16 (хотя пробовал и с 6.0.18).А>Проблема с антивирусом скорее всего. Настройте исключение для локалхоста и все должно заработать. В качестве теста попробуйте сначала отключить антивирус и запустить томкат из идеи
Да я уже давно решил проблему (см. выше). Она и в самом деле была в антивирусе.Tomcat Server Error — Port 8080 already in use
‘Starting Tomcat v8.0 Sever at localhost’ has encountered a problem. Port 8080 required by Tomcat v8.0 Server at localhost is already in use. There 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).
What should I do to stop the process? I’m assuming that Tomcat 7 server must be stopped. How shall I do it if my operating system is Windows 8? Error Screenshot:
2,365 5 5 gold badges 32 32 silver badges 43 43 bronze badges
asked Dec 13, 2015 at 17:03
Gayathri Ravi Gayathri Ravi
1,459 1 1 gold badge 12 12 silver badges 18 18 bronze badgesIf you’re running tomcat from Eclipse, then check in the Servers view (in the bottom dock) if it’s running.
Dec 13, 2015 at 17:09
Run the cmd as administrator for above answers.
Jan 7, 2021 at 10:2820 Answers 20
For Ubuntu/Linux
Step 1: Find the process id that is using the port 8080
netstat -lnp | grep 8080 or ps -aef | grep tomcat
Step 2: Kill the process using process id in above result
kill -9 process_id
For Windows
Step 1: Find the process id
netstat -ano | findstr 8080
Step 2: Open command prompt as administrator and kill the process
taskkill /F /pid 1088
In my case port 8005 was already in use so I used the same above steps.
answered Nov 27, 2017 at 10:58
Tarun Kumar Tarun Kumar
2,968 3 3 gold badges 15 15 silver badges 17 17 bronze badges
how do you find the pid?
Oct 23, 2018 at 10:33
pid is a four digit number on the far right as displayed on the picture
Feb 26, 2021 at 13:14this solutions worked for me in Ubuntu 21.04, process id shown in the end like 20322/java. I used 20322 to kill
Sep 14, 2021 at 13:05
All I had to do was to change the port numbers .
- Open Eclipse
- Go to Servers panel
- Right click on Tomcat Server select Open , Overview window will appear.
- Open the Ports tab. You will get the following:
- Tomcat adminport
- HTTP/1.1
- AJP/1.3
- I changed the port number of HTTP/1.1 (i.e. to 8081 )
- You might have to also change the port of Tomcat adminport (i.e. to 8006 ) and of AJP/1.3 (i.e. to 8010 ).
- Access your app in the browser at http://localhost:8081/.
1,014 2 2 gold badges 12 12 silver badges 23 23 bronze badges
answered Dec 14, 2015 at 4:19
Gayathri Ravi Gayathri Ravi
1,459 1 1 gold badge 12 12 silver badges 18 18 bronze badges
Right click where?
Dec 26, 2017 at 16:26
Just double click on the tomcat server in the server panel and it will open the overview window.
Mar 5, 2022 at 23:27In case of MAC users, go to Terminal and do the following
lsof -i :8080 //returns the PID (process id) that runs on port 8080 kill 1234 //kill the process using PID (used dummy PID here) lsof -i :8443 kill 4321
8080 is HTTP port and 8443 is HTTPS port, by default.
answered Jun 22, 2018 at 11:59
Vignesh Raja Vignesh Raja
8,037 1 1 gold badge 33 33 silver badges 42 42 bronze badgesthanks convenient solution when debugging eclipse server apps with tomcat and server not shutdown properly
Jul 15, 2020 at 8:35
+1 lsof is better solution for Mac users than ps -aef, since you get back headers and get to see which is PID and which is parent PID etc
Sep 1 at 20:02
If you want to regain the 8080 port number you do so by opening the task manager and then process tab, right click java.exe process and click on end process as shown in image attached.
answered Dec 14, 2015 at 13:10
Arun Gunalan Arun Gunalan
814 7 7 silver badges 27 27 bronze badgesThis will end entire Eclipse Application Right? I just want to terminate the tomcat instance which is using 8080 port
Jul 19, 2016 at 6:18
No, this will not end your eclipse application.
Jan 11, 2017 at 9:32this works in Linux system monitor as well just do a search for Java. What is interesting is I stopped the server in eclipse and closed eclipse and still TC Server was still running on 8080 not sure what is up with that.
Sep 11, 2017 at 18:34
netstat -ano | findstr 8080 taskkill /pid 21424 /F
execute the above command in command prompt first command will find the pid of the processes which are using port 8080 or any other port you are using. And in second command write the pid of instead of 21424.
answered Feb 22, 2017 at 20:18
Sanket Patel Sanket Patel
901 9 9 silver badges 21 21 bronze badges$ taskkill /pid 4108 /F ERROR: Invalid argument/option — ‘C:/Program Files/Git/pid’. Type «TASKKILL /?» for usage.
Dec 26, 2017 at 16:20
are you providing proper pid of your port?
Jul 27, 2018 at 1:40Since it is easy to tackle with Command Prompt. Open the CMD and type following.
netstat -aon | find "8080"
If a process uses above port, it should return something output like this.
TCP xxx.xx.xx.xx:8080 xx.xx.xx.xxx:443 ESTABLISHED 2222
The last column value (2222) is referred to the Process ID (PID).
Just KILL it as follows.
taskkill /F /PID 2222
Now you can start your server.
answered Apr 22, 2019 at 2:26
11.7k 2 2 gold badges 71 71 silver badges 52 52 bronze badgesYou can use the troubleshooting tips below.
Troubleshooting Tip #1
- Exit Eclipse
- Open a web browser and visit, http://localhost:8080
- If you see a «Tomcat» web page then that means Tomcat is running as a Windows service. To stop Tomcat running as a Windows services, open your Windows Control Panel. Find the service «Apache Tomcat» and stop it.
- If you don’t see a «Tomcat» web page, then stop the appropriate process displayed.
— Troubleshooting Tip #2 — GUI Option
Steps to free port which is already used to run Tomcat server in Eclipse
- On MS Windows, select Start > All Programs > Accessories > System Tools >Resource Monitor
- Expand the Network Tab
- Move to the section for Listening Ports
- Look in the Port column and scroll to find entry for port 8080
- Select the given process and delete/kill the process
- Return back to Eclipse and start the Tomcat Server, it should start up now.
Troubleshooting Tip #3 — Command-Line Option
Steps to free port which is already used to run Tomcat server in Eclipse
For example , suppose 8080 port is used , we need to make free 8080 to run tomcat
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
C:\Users\username>taskkill /F /PID 3116
Step 3: Return back to Eclipse and start the Tomcat Server, it should start up now.
Step 0: Exit Eclipse
Step 1: Open a terminal window
Step 2: Enter the following command to find the process id
lsof -i :8080 This will give output of the application that is running on port 8080
Step 3: Enter the following command to kill the process
kill $(lsof -t -i :8080)
Step 4: Return back to Eclipse and start the Tomcat Server, it should start up now.
answered Aug 7, 2020 at 8:24
pavankumar pavankumar
317 5 5 silver badges 12 12 bronze badgesYou can solve this in two steps:
STEP 1: Open the Command prompt and type netstat -a -o -f and press enter (the above command will show all the processes running on your machine) https://i.stack.imgur.com/m66JN.png
STEP 2: Type TASKILL /F /PID 4036 (where F stands for force and PID stands for parent Id and 4036 stands for process id of 8080, here I am using some random number) https://i.stack.imgur.com/Co5Tg.png
Few times when you are trying to kill process it will throw an exception telling that access is denied as shown in the above screenshot, at that point of time you are supposed to open command prompt as run as administrator https://i.stack.imgur.com/JwZTv.png
Then come back to eclipse clean the project and then try to run the project
How to fix “Port 8080 already in use” error on a Mac
If you’re a developer working on a Mac, you may encounter the “Port 8080 already in use” error when trying to start a Java web server or some other application that listens on that port. This error typically means that another application or service is already using port 8080, which prevents your application from starting.
In this article, we’ll show you how to use the sudo kill -9 command to terminate the process using port 8080, freeing up the port for your application to use.
Step 1: Identify the process using port 8080
The first step in resolving the “Port 8080 already in use” error is to identify the process that’s currently using the port. To do this, open a terminal window and run the following command:
lsof -i :8080
This command will list all the processes using port 8080. You should see something like this:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 12345 user 42u IPv6 0xa1b2c3d4e5f67890 0t0 TCP *:http-alt (LISTEN)In this example, the process using port 8080 is a Java process with the PID (process ID) of 12345.
Step 2: Terminate the process using sudo kill -9
Now that you’ve identified the process using port 8080, you can terminate it using the sudo kill -9 command. This command sends a SIGKILL signal to the specified process, forcing it to terminate immediately.
To terminate the process, run the following command in your terminal:
sudo kill -9 12345
Replace 12345 with the PID of the process you identified in step 1.
After running this command, the process using port 8080 should be terminated, freeing up the port for your application to use.
Step 3: Restart your application
Now that you’ve freed up port 8080, you can try starting your Java web server or application again. It should now start successfully without encountering the “Port 8080 already in use” error.
I hope this article helps you resolve the “Port 8080 already in use” error on your Mac!