Skip to content
Advertisement

Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

I am totally new to Spring and started to do the official guides from this site: https://spring.io/guides

I’d like to do this guide: https://spring.io/guides/gs/scheduling-tasks/

I get the following Exception:

JavaScript

The application starter class is this:

JavaScript

As you can see, the main method contains a commented line. I’ve already done a tutorial, namely this one: https://spring.io/guides/gs/consuming-rest/ It’s up and running. But I can’t run the ScheduledTasks app, which is the following:

JavaScript

I use Eclipse and run the Application.java’s main as an Application. Could someone please help me?

Advertisement

Answer

The scheduling guide isn’t a web app so you probably have some mouldy stuff in your pom.xml from the REST guide? If you follow the instructions closely it should work. Another potential issue with the code you posted above is that your @EnableAutoConfiguration class is not used in the context, only as a main method (which may not be a problem for the scheduling guide but it probably is for a bunch of others).

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement