Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

錯誤信息:

Unable to start web server; nested exception is org.springframework.context.ApplicationContextException:

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

全部錯誤信息無法截圖,目前只有部分,這個項目是在搭建Boot項目時第一次啓動時報的錯誤,錯誤內容大概的意思是:未能加載嵌入的供web應用加載的空間,是因爲缺少ServletWebServerFactory bean,解決方案是在啓動類上添加如下註解即可

@EnableAutoConfiguration

這個註解的意思是自動化配置,但是奇怪的是加上之後只要啓動一遍,把這個註釋去掉也不會報錯,如果知道爲什麼請留言告訴我!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章