I'm getting this error when trying to resolve "Server failed to start for port 8080: Address already in use
"
Error executing script 8888: For input string: ""
Can anybody help? Don't know what's wrong. Thanks.
error occurs because port 8080 is already configured with another application, or port 8080 has not been released yet. The spring boot application is trying to configure port 8080 to start a web server. Since the port can not be used, this error is thrown.
When the port number 8080 is already used and you want to reuse the same port , you should kill its process :
First, check the pid of the process that is using port 8080. To do this run:
lsof -w -n -i tcp:8080
In the example above, the pid is 3812 for process that is using port 9090
Take note of the PID. The PID could be different on your machine. We need this for executing the next command:
so you will have to test it via run-app:
grails run-app
UPDATE :
As the output of lsof -w -n -i tcp:8080| awk '{print $2}'|awk 'END{print}'
is the PID
, You can kill the port process by PID automatically :
kill -9 `lsof -w -n -i tcp:8080| awk '{print $2}'|awk 'END{print}'`
If you're using Grails/Groovy Tool Suite ( Eclipse based IDE ), select Run as > Run Configurations.... Then, in Grails tab, input like this :
-Dserver.port=8050 run-app
So, Grails will run on port 8050 instead of the default port (8080).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With