I know there are others questions on this, and I have checked them, but none solves my issue.
Very simple POM, ready:ing my app for use with an embedded web server, simply so I can start it up...
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Very easy Boot class:
@SpringBootApplication
@RestController
public class SpringBootApp {
public static void main(String[] args) {
SpringApplication.run(SpringApplication.class, args);
}
@RequestMapping(value = "/")
public String hello() {
return "Hello World from Tomcat";
}
}
Tried:
- Extend the SpringBootServletInitializer class.
- Update spring-boot-starter-parent to the latest (2.1.3).
- Setting spring.profiles.active=default in application.properties.
- Manually inject TomcatWebServerFactory (ugh...) in @Configuration class.
- Run mvn dependency:purge-local-repository and removed /repository dir from my .m2 dir, fetching all again with mvn clean install -U.
ETC... I do not see why it is not working, I though Spring Boot was supposed to be easy.
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.