错误:
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
org.springframework.context.ApplicationContextException:无法启动web服务器;嵌套异常为org.springframework.boot.web.server.WebServer异常:无法启动嵌入式Tomcat
原因:
版本问题
springBoot和springCloud依赖
解决:
1、修改pom.xml文件配置
2.3.0 改为 2.1.6

2、ApplicationTests类报错
修改
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
class ResourceSharingApplicationTests {
@Test
void contextLoads() {
}
}
或删掉

3、项目名有个红叉叉
右键 -- Maven -- Update Project

博客主要讲述了Spring Boot项目中出现无法启动web服务器、无法启动嵌入式Tomcat的错误。针对该错误给出了解决办法,包括修改pom.xml文件配置版本,处理ApplicationTests类报错,以及通过右键Maven更新项目来解决项目名红叉问题。
4922

被折叠的 条评论
为什么被折叠?



