I\'m developing a REST API using Spring Framework.
First I wasn\'t able to run my application because of the same problem. The port 8080 on my computer is busy. Then I
this issue can be resolved using 2 ways:
netstat -ao | find "8080" Taskkill /PID 1342 /F
server.port=8081
Issue: It's because either you are not stopping your application or the application is already somehow running on the same port somehow.
Solution, Before starting it another time, the earlier application needs to be killed and the port needs to be freed up.
Depending on your platform you can run the below commands to stop the application,
on windows
netstat -anp | find "your application port number"` --> find PID
taskkill /F /PID
on Linux,
netstat -ntpl | grep "your application port number"
kill pid // pid you will get from previous command
on Mac OS
lsof -n -iTCP:"port number"
kill pid //pid you will get from previous command
We have had the same issue in eclipse or intellij. After trying many alternative solutions, I found simple solution - add this config to your application.properties:
spring.main.web-application-type=none
There are two options to handle/avoid this situation.
Open the console --> right click --> terminate all.