Every Spring Boot exception on start is registered and handled by one of the FailureAnalyzers responsible for wrapping errors and providing human-readable message about what went wrong.
For example when you are trying to run Spring Boot on port that is already in use you should see something similar to the following message (that cames from LoggingFailureAnalysisReporter):
2. Application failed to start - port 8080 already taken
When you see an error like: 'The Tomcat connector configured to listen on port 8080 failed to start', that means another application or service is running on port 8080, and your current instance cannot be started on the same port.
There are a couple of things you can do about this:
change port for starting instance,
stop other service running on port 8080.
2.1. Changing the starting port for Spring Boot instance
If you don't want to stop the other service running on port 8080, because it is used for different systems, you can change starting port for your Spring Boot by setting server.port parameter in the Spring Boot configuration file.
2.2. Stop service running on port 8080
if you have knowledge about the service running on port 8080 simply stop it and run your Spring Boot application,
if you don't know what service is blocking your 8080 port try following commands:
On ubuntu use lsof command to find out what is running on a specific port:
The output should look like this:
You can now stop this service by sending -9 signal to this process id (PID) .
After unblocking 8080 port, Spring Boot should start without a failure:
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}