Spring Boot app not working when deployed into standalone Tomcat
Have you made sure you followed the section on traditional deployments of the Boot reference documentation? From what you describe, it doesn't look like Spring Data REST or MongoDB not working but the deployment not really working at all.
The trick should be to let the main configuration class you have to implement a special interface so that the servlet container can find the configuration to bootstrap (sample taken from the reference docs):
@Configuration
@EnableAutoConfiguration
@ComponentScan
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
}
SpringBootServletInitializer
is the key aspect here as it's the type that hooks into the Servlet 3 bootstrap mechanism for traditional web apps. The reference docs also have instructions of how to make a boot app work in Servlet containers prior to Servlet 3.0.
Also note, that when an app is deployed into a standalone container, it's usually not available via the root (i.e. http://localhost:8080/
) but a dedicated context named after the WAR file deployed (e.g. http://localhost:8080/my-app
).