8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE

We Are Going To Discuss About 8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE. So lets Start this Java Article.

8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE

  1. 8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE

    It was resolved with following steps,
    Check what processes are running at available ports
    netstat -ao |find /i "listening"
    We get following
    TCP 0.0.0.0:7981 machinename:0 LISTENING 2428

  2. 8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE

    It was resolved with following steps,
    Check what processes are running at available ports
    netstat -ao |find /i "listening"
    We get following
    TCP 0.0.0.0:7981 machinename:0 LISTENING 2428

Solution 1

It sometimes happen even when we stop running processes in IDE with help of Red button , we continue to get same error.

It was resolved with following steps,

  1. Check what processes are running at available ports

    netstat -ao |find /i "listening"

    We get following

    TCP 0.0.0.0:7981 machinename:0 LISTENING 2428
    TCP 0.0.0.0:7982 machinename:0 LISTENING 2428
    TCP 0.0.0.0:8080 machinename:0 LISTENING 12704
    TCP 0.0.0.0:8500 machinename:0 LISTENING 2428

    i.e. Port Numbers and what Process Id they are listening to

  2. Stop process running at your port number(In this case it is 8080 & Process Id is 12704)

    Taskkill /F /IM 12704 (Note: Mention correct Process Id)

For more information follow these links Link1 and Link2.

My Issue was resolved with this, Hope this helps !

Original Author rdj7 Of This Content

Solution 2

For Mac users(OS X El Capitan):

You need to kill the port that localhost:8080 is running on.
To do this, you need to do two commands in the terminal :N

sudo lsof -i tcp:8080

kill -15 PID 

NB! PID IS A NUMBER PROVIDED BY THE FIRST COMMAND.

The first command gives you the PID for the localhost:8080.
Replace the PID in the second command with the PID that the first command gives you to kill the process running on localhost:8080.

Original Author jsog Of This Content

Solution 3

The reason is one servlet container is already running on port 8080 and you are trying to run another one on port 8080.

    1. Check what processes are running at available ports.

      • For Windows :

      • netstat -ao |find /i "listening"
        Image01

      OR

      • netstat -ano | find "8080" (Note: 8080 is port fail to start)
        Image02
    1. Now try to reLaunch or stop your application.

      • To relaunch: you can press this button

    Image03

    • To stop in windows:

    Taskkill /F /IM 6592
    Note: Mention correct Process Id

    Image04

    right click on the console and select terminate/disconnect all

    • Go to Task Manager and end Java(tm) platform se binary

    click here to view image

    What is java(tm) platform se binary(Search in google

Another option is :

Go to application.properties file set server.port=0. This will cause Spring Boot to use a random free port every time it starts.

Original Author Thimira Pathirana Of This Content

Solution 4

Create application.properties file under src/main/resources folder and write content as

server.port=8084

Its runs fine.
But every time before run need to stop application first by click on red button upper on the IDE
enter image description here

or try

RightClick on console>click terminate/Disconnect All

Original Author MangduYogii Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment