08-02-2023, 03:42 PM
in my case i already had the maven dependency to 'spring-boot-starter-web' and the project would start fine without auto-stopping when i run it as springboot app **from within the IDE**. however, when i deploy it to **K8s**, the app would start and auto-stop immediately. So i modified my main app class to extend SpringBootServletInitializer and this seems to have fixed the auto-stopping.
@SpringBootApplication public class MyApp extends SpringBootServletInitializer { public static void main(String[] args) {
SpringApplication.run(MyApp.class, args); }}
@SpringBootApplication public class MyApp extends SpringBootServletInitializer { public static void main(String[] args) {
SpringApplication.run(MyApp.class, args); }}