I have strange thing when I try to modify Spring project inside my Spring Tool Suite. On the first load (deploy) everything is fine, application compiles and runs on localhost:8080
When I change something inside code and try to redeploy it (Run it again - Run As Spring Boot App) I get error message
*************************** APPLICATION FAILED TO START
Description:
The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.
Action:
Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.
2016-10-19 00:01:22.615 INFO 10988 --- [ main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3023df74: startup date [Wed Oct 19 00:01:19 CEST 2016]; root of context hierarchy 2016-10-19 00:01:22.616 INFO 10988 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
If I shutdown process on that port manually everything works fine again, but this can't be right way of redeploying Spring app. Am I doing something wrong here?
I'm using :: Spring Boot :: (v1.4.1.RELEASE)
P.S. I'm aware that I can setup some kind of hot-swap mechanism to have automatic reload of page after I change code, but for now I would like to resolve this issue first.
Thanks for any kind of help or info.
There are some processes left in the background on that port, several reasons can cause this problem, but you can solve easily if you end process which is related to 8080 or Spring.
If you are using Linux there is steps how to end process:
this will kill process which is left on 8080 port and let you run application.
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,
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
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 this link.
My Issue was resolved with this, Hope this helps !
In Spring Boot Application (Using Spring Starter Project) We Have Update Port in Server.xml using Tomcat server and Add this port in application.property( insrc/main/resources) the code is server.port=8085
And update Maven Project then run application
Yes, you are. One servlet container is already running on port 8080 and you are trying to run another one on port 8080 again.
Either restart the server (If there is button for that in STS) or stop and start it
You have to stop the current process and run your new one. In Eclipse, you can press this button to ReLaunch your application:
In my case, the error occurred as the application was unable to access the keystore for ssl.
Starting the application as root user fixed the issue.