I am facing the issue where when I am running my spring boot application via Command line
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev -Dserver.port=8083"
This works fine, but running as Application in intellij I am getting below errors -
Application run failed,
exc.stack=org.springframework.context.ApplicationContextException:
Unable to start web server; nested exception is org.springframework.context.ApplicationContextException:
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.\n\tat org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
What can be the possible reasons, and where should I look into configurations fixes?
There are other questions on this pattern, but none of them have mentioned the error -