blue-sky blue-sky - 1 year ago 161
Java Question

How to run spring boot app in Eclipse tomcat?

I have a Spring boot application and want to run this as a server app within Eclipse.
So the app will be recognized as a Tomcat web app and can be added I update the facet :

enter image description here

When I run the web app my rest services are not being found. A spring boot app contains a different folder structure than spring apps before spring boot was released. Can a spring boot app be run from an eclipse configured tomcat ? Also prior to spring boot the controllers section of the app needs to specified. Do I need to update my spring boot app with these settings in order to run from Eclipse tomcat ?

I don't want to create a war and then copy it to webapps folder of tomcat.

Update : The reason to run this app within Eclipse tomcat container is that I have other non spring boot applications that my new spring boot app will depend on.

leo leo
Answer Source

Check your pom.xml:


Then check your main app class:

public class Application extends SpringBootServletInitializer {

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);

    public static void main(String[] args) {, args);

Then configure Project Facets (as you have already did):

  • Dynamic Web Module
  • Java
  • Javascript

Then check your Deployment Assembly: enter image description here