Spring boot: Unable to start embedded Tomcat servlet container

We Are Going To Discuss About Spring boot: Unable to start embedded Tomcat servlet container. So lets Start this Java Article.

Spring boot: Unable to start embedded Tomcat servlet container

  1. Spring boot: Unable to start embedded Tomcat servlet container

    You need to add the tomcat dependency in your pom
    <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dependency>

  2. Spring boot: Unable to start embedded Tomcat servlet container

    You need to add the tomcat dependency in your pom
    <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dependency>

Solution 1

Try to change the port number in application.yaml (or application.properties) to something else.

Original Author Aziz Of This Content

Solution 2

You need to add the tomcat dependency in your pom

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>

Original Author cralfaro Of This Content

Solution 3

If you are running on a linux environment, basically your app does not have rights for the default port.

Try 8181 by giving the following option on VM.

-Dserver.port=8181

Original Author Kıvılcım Of This Content

Solution 4

In my condition when I got an exception ” Unable to start embedded Tomcat servlet container”,

I opened the debug mode of spring boot by adding debug=true in the application.properties,

and then rerun the code ,and it told me that java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String

Thus, we know that probably I’m using a servlet API of lower version, and it conflicts with spring boot version.

I went to my pom.xml, and found one of my dependencies is using servlet2.5,
and I excluded it.

Now it works. Hope it helps.

Original Author Norman Bai Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment