Spring boot Unable to start embedded Tomcat servlet container
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
"Unable to start embedded Tomcat servlet container" is a wrapper error, not the root cause. Tomcat failed during startup, but the real reason is almost always lower in the stack trace: port conflict, broken bean initialization, invalid servlet configuration, or a missing dependency.
The fastest way to solve it is to ignore the headline message and read the first meaningful exception beneath it. Tomcat is often just the messenger.
Start with the Real Cause
When Spring Boot fails at startup, the console usually shows a chain of exceptions. The useful one is often one or two levels below the top-level Tomcat error.
Typical examples:
- '
PortInUseException' - '
BeanCreationException' - '
ApplicationContextException' - '
ClassNotFoundException' - '
NoSuchMethodError'
Your first task is to identify which of those actually caused the container bootstrap to fail.
Common Causes
Port Already in Use
If another service is already listening on port 8080, embedded Tomcat cannot bind.
Or inspect the port owner at the OS level before changing configuration.
Dependency or Classpath Conflict
Mixing incompatible versions of Spring Boot, Tomcat, Jakarta Servlet APIs, or unrelated starter dependencies can prevent startup. This is especially common after manual version overrides.
Use your build tool to inspect the resolved dependency tree:
Bean Initialization Failure
Sometimes Tomcat is fine, but the web application context fails first because a required bean throws during creation. That still bubbles up as an embedded-container startup failure.
Invalid Web Configuration
Examples include:
- broken
FilterorServletregistration - invalid context path settings
- malformed configuration properties
- application code touching unavailable infrastructure during startup
A Small Example of a Startup Failure
This bean throws before the application is ready, which can prevent the server from starting:
In a real project, the Tomcat failure message would often appear above the real exception, but the real fix is to remove the bean failure.
A Better Debugging Routine
Work in this order:
- read the first nested exception with a concrete class name
- check whether the port is already bound
- inspect recent dependency changes
- look for beans that perform risky work during startup
- confirm Java and Spring Boot version compatibility
That process is faster than changing random properties and rerunning.
Example of Safer Startup Design
Keep startup beans light and defer expensive or fragile work until after the application context is ready:
This is not a cure-all, but it helps separate container startup from later application logic.
Common Pitfalls
- Treating the Tomcat headline message as the root cause.
- Changing
server.portbefore checking whether the actual problem is a bean failure. - Overriding Spring-managed dependency versions manually without checking compatibility.
- Doing database or network calls inside bean construction with poor error handling.
- Reading only the first line of the error output and missing the nested exception that matters.
Summary
- "Unable to start embedded Tomcat" is usually a wrapper around a more specific startup failure.
- The real fix comes from the nested exception, not the top-level message.
- Port conflicts, bean creation errors, and dependency mismatches are the most common causes.
- Use a structured debugging order instead of changing random settings.
- Tomcat often fails because the application context failed first.
Related reading
- standard_init_linux.go178 exec user process caused exec format error
- standard_init_linux.go178 exec user process caused exec format error
- standard_init_linux.go190 exec user process caused no such file or directory - Docker
- standard_init_linux.go211 exec user process caused exec format error
- Spring Boot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
- Spring Boot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
- Spring Boot Unit Test ignores logging.level
- Spring boot validation annotations Valid and NotBlank not working

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.