3

Normally, when you developing a simple mvc application, with maven, based on Spring Boot, you starts from SpringApplication.run(.class, args), then endpoint that returns you e.g. "Hello World". After that you write mvn spring-boot:run (or start it by your ide) and Spring makes everything for you.

Spring also setting up Tomcat servlet container, and then deploy your package to that, so you don't need to make it manually.

And my question:

How exactly Spring starts that Tomcat service? If i would like to start in same way some other services e.g. Apache Felix, Apache Jackrabbit or some other, what should I do? Is that any configured bean that is set in starter package, or some other mechanism?

nowszy94
  • 3,151
  • 4
  • 18
  • 33
  • It uses the Tomcat Embedded API. So it's not a "service starting thing", it just starts Tomcat in the same VM as your application. – Tome Oct 26 '16 at 08:59
  • @Tome Do you know where in spring code it is started? – nowszy94 Oct 26 '16 at 11:20
  • 2
    https://github.com/spring-projects/spring-boot/blob/master/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainer.java – Tome Oct 26 '16 at 13:58
  • 1
    Check this answer I wrote for another question: http://stackoverflow.com/a/39321644/641627. The answer would in fact be more accurate for your question – alexbt Oct 31 '16 at 03:00

0 Answers0