[英]Application Running via Spring Boot Run but not via IntelliJ Idea
我面臨的問題是,當我通過命令行運行 Spring Boot 應用程序時
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev -Dserver.port=8083"
這工作正常,但在 intellij 中作為應用程序運行時出現以下錯誤 -
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)
可能的原因是什么,我應該在哪里查看配置修復?
關於這個模式還有其他問題,但他們都沒有提到錯誤——
Spring Boot 應用程序通過 Maven 運行良好,但不能通過 IDE Intellij IDEA
ApplicationContextException: Unable to start ServletWebServerApplicationContext 由於缺少 ServletWebServerFactory bean (對於缺少 servlet bean,但如果是這種情況,那么應用程序也不應該通過命令行啟動)
所以,我在那里找不到任何答案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.