Reputation: 117
While launching spring-boot application, I am always getting the below error. I tried changing the ports to 8181, 8585, 9191, etc but still the same error.
I tried everything mentioned in Launching Spring application Address already in use but nothing worked for me. Also, this was working fine until yesterday and stopped working when I added spring-actuator related maven dependency and properties (this is my observation not sure even if it is related).
Error :
2021-05-20 18:15:21.283 DEBUG 10256 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
Application failed to start due to an exception
org.springframework.boot.web.server.PortInUseException: Port 8080 is already in use
at org.springframework.boot.web.server.PortInUseException.lambda$throwIfPortBindingException$0(PortInUseException.java:70) ~[spring-boot-2.4.5.jar:2.4.5]
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 8080 was already in use.
Action:
Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
My application.properties:
logging.level.org.springframework = debug
server.port=8080
management.endpoints.web.exposure.include=*
Any suggestion, please ? Thanks for your help in advance.
Upvotes: 1
Views: 2495
Reputation: 61
There must be some application running or already using port 8080 in your system. Here are few suggestions that might help.
open command prompt and try :
> netstat -aon | find /i "8080"
output>
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 13568
TCP [::]:8080 [::]:0 LISTENING 13568
The last number shown in the above output is PID for running port 8080, try to kill that process. Note: PID might differ in your system
>taskkill /F /PID 13568
If this doesn't work, then try restating your IDE and change the port. Also, you mentioned that problem started when you added actuator dependencies. Please check once by removing those dependencies and properties, not sure if hal-explorer is creating the problem.
Upvotes: 2