• Register
0 votes
102 views

Problem :

Facing bellow Spring boot error
unable to start embeddedwebapplicationcontext due to missing embeddedservletcontainerfactory bean.
6 5 3
6,930 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

I also faced the issue in the past.
I used bellow jar to get rid of the issue.

use bellow jar in your pom.xml :

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

or try this one  in your pom.xml :

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
9 7 4
38,600 points
0 votes

This error suggests that the application you are trying to run cannot instantiate an instance of apache tomcat. Make sure you are running the applications with tomcat.

Solutions:

This error can be solved in two ways;

Check all dependencies:

If after checking all your dependencies you experience the same problem, then try to add the following code in your configuration class;

public EmbeddedServletContainerFactory servletContainer() {

    TomcatEmbeddedServletContainerFactory factory =

                  new TomcatEmbeddedServletContainerFactory();

    return factory;

 }

External Instance:

If you are using an external instance of tomcat (especially for IntelliJ ), the problem could be that the IDE is trying to start the embedded tomcat. In this case, remove the following from your pom.xml and then configure the external tomcat using the “Edit Configuration” wizard.

<dependency>

     <groupId>org.springframework.boot</groupId>

     <artifactId>spring-boot-starter-tomcat</artifactId>

     <scope>provided</scope>

</dependency>

Note:

If you are encountering this error while using IntelliJ and you are trying to start the application with the run button, Try starting the application from the command line instead, like ensure that you are incorrect directory assuming this is as spring boot application run mvn spring-boot: run.

Additionally, you can also see an error when your spring application depends on another application. In this case, you have to start the other application first an

11 5 2
3,890 points

Related questions

0 votes
1 answer 9 views
9 views
Problem: due to missing embeddedservletcontainerfactory bean.Unable to start embeddedwebapplicationcontext
asked Feb 23 Muneeb Saadii 130k points
0 votes
1 answer 313 views
313 views
Problem : I have written a spring batch application using the Spring boot and when I tried to run it on linux server facing following exception unable to start servletwebserverapplicationcontext due to missing servletwebserverfactory bean
asked Nov 14, 2019 peterlaw 6.9k points
0 votes
1 answer 24 views
24 views
Problem: org.apache.catalina.lifecycleexception: failed to start component [connector[http/1.1-8080]]
asked Feb 18 Lucky Guy 1.5k points
0 votes
1 answer 1.2K views
1.2K views
Problem : Currently I am trying to develop the REST API using the Spring Framework I am unable to run my application because of below error. Description: The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may ... this application to listen on another port. My 8080 port on my PC is seems to be busy. How can I fix this issue?
asked Feb 28, 2020 mphil 2.3k points
0 votes
1 answer 2 views
2 views
Problem: Please help me to solve it. Spring-boot-starter-security
asked Apr 3 Ifra 24.4k points
0 votes
1 answer 3 views
3 views
Problem: Spring-boot-configuration-processor.
asked Mar 22 Dan phillip 4.8k points
0 votes
1 answer 10 views
10 views
Problem: I am migrating from Spring Boot 1.4.9 to Spring Boot 2.0 and also to Spring Security 5 and I am trying to do authenticate via OAuth 2. But I am getting this error: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null
asked Mar 19 ummesalma 25.2k points
1 vote
1 answer 9 views
9 views
Problem : In spring Java ,When I tested it, only application.properties gets picked up and rest of properties are still picked up from /src/main/resources. I have tried supplying them as comma separated list to spring.config.location but the default set is still not being overriden. How do I make mulitiple external config files override default ones?
asked Mar 6 Shovo210 13.9k points
0 votes
1 answer 669 views
669 views
Problem : I am very new to Spring Boot. I am learning to write code in Spring Boot. I have written my first Spring Boot code as below @RequestMapping(value = "/bar/foo", method = RequestMethod.GET) public MyResponseEntity<foo> foo() { Foo model; ... return ... .core</groupId> <artifactId>jackson-databind</artifactId> <version>2.4.3</version> </dependency> How can I fix above Spring Boot exception?
asked Feb 29, 2020 mphil 2.3k points
0 votes
1 answer 22 views
22 views
Problem: unable to start servletwebserverapplicationcontext due to missing servletwebserverfactory bean.
asked Feb 23 Muneeb Saadii 130k points