• Register
0 votes
56 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 243 views
243 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 737 views
737 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 453 views
453 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 4.4K views
4.4K views
Problem : After executing spring boot with h2 database and JPA i am facing below error org.hibernate.tool.schema.spi.commandacceptanceexception: error executing ddl via jdbc statement
asked Nov 12, 2019 peterlaw 6.9k points
0 votes
1 answer 25 views
25 views
Problem: I have already seen many questions asked around the error which I am facing. But available solutions are not working for me. It may be the case that I am yet to thoroughly understand a auto wiring concept. I am able to navigate to the required page, ... least 1 bean which qualifies as autowire candidate. Now I am completely confused. Hope someone can try to help me out with this error.
asked Aug 8, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 4.9K views
4.9K views
Problem : I am developing the application in Spring, using a Tomcat, Mysql5, Java8... My problem is that I cannot deploy it, due to the "required bean 'entityManagerFactory' not found" problem. I have developed my project with the coworkers but ... a bean named 'entityManagerFactory' that could not be found. Action: Consider defining a bean named 'entityManagerFactory' in your configuration.
asked Jan 25, 2020 jwilliam 3.9k points
1 vote
1 answer 2.7K views
2.7K views
Problem : When I try to compile my spring project, I always face the below error : Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed I have the ... >1.4.1.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> . . .
asked Dec 12, 2019 alecxe 7.5k points
0 votes
2 answers 213 views
213 views
Problem : I have created entities, services and JUnit tests for services using Spring and Hibernate for my project. All of these are working. After that I added spring-mvc to it to make this web application but while trying to make ... follows ..Could not autowire field: public pl.com.radzikowski.webmail.service.IMailManager pl.com.radzikowski.webmail.controller.HomeController.mailManager...
asked Nov 20, 2019 peterlaw 6.9k points
0 votes
1 answer 48 views
48 views
Problem : For many days I am trying to create Spring CRUD application but getting following error org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean with name
asked Nov 13, 2019 peterlaw 6.9k points
0 votes
1 answer 750 views
750 views
Problem : I am implementing kerberos Authentication in my existing java spring application.My unix team has provided me SPN, krb5.conf and keytab file. I am trying hard but getting unable to obtain password from user exception
asked Oct 22, 2019 peterlaw 6.9k points