已解决:SpringBoot启动报错:Unable to start web server; nested exception is org.springframework.boot.web
Posted 小企鹅推雪球!
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了已解决:SpringBoot启动报错:Unable to start web server; nested exception is org.springframework.boot.web相关的知识,希望对你有一定的参考价值。
文章目录
报错信息
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) ~[spring-context-5.2.10.RELEASE.jar:5.2.10.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.5.RELEASE.jar:2.3.5.RELEASE]
......
报错原因
查了一些解决方案,但是最后发现这个报错是因为:在pom引用了jackson相关包,但没有引用完整导致的
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
<scope>compile</scope>
</dependency>
这个Jackson 是当前用的比较广泛的,用来序列化和反序列化 json 的 Java 的开源框架。
解决方案:引用完整的依赖
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.8</version>
</dependency>
以上是关于已解决:SpringBoot启动报错:Unable to start web server; nested exception is org.springframework.boot.web的主要内容,如果未能解决你的问题,请参考以下文章
解决springboot启动失败问题:Unable to start embedded container;
org.springframework.context.ApplicationContextException Unable to start web server报错(已解决)
unable to boot the simulator,无法启动模拟器已解决
springboot报错Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFac