问题:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

初次使用IDEA自带的Tomcat时,在maven中添加坐标,应修改scope的值为compile

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
</dependency>

应修改为:

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>compile</scope>
</dependency>

发布了11 篇原创文章 · 获赞 6 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/m0_37762912/article/details/104448267