异常记录:Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerEx

编程入门 行业动态 更新时间:2024-10-28 07:29:21

<a href=https://www.elefans.com/category/jswz/34/1771210.html style=异常记录:Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerEx"/>

异常记录:Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerEx

项目突然报错,启动失败
Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcatat org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415)at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)at com.derbysoft.waterfall.pusher.application.PusherApplication.main(XXXApplication.java:51)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcatat org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142)at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104)at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:478)at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160)... 8 more
Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[/prj_name-module_name] failed to startat org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:187)at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:126)... 13 moreProcess finished with exit code 0

通过打断点发现TomcatService的host的state是SOPPED状态,所以抛出了[failed to start]这个异常,但是为什么是SOPPED状态的原因并没有发现

解决方案:不用Springboot内嵌的Tomcat,使用本地Tomcat启动

发现堆栈信息与之前有些不一样,多了具体的异常报错

Caused by: java.lang.IllegalArgumentException: The servlets named [A_Servlet] and [B_Servlet] are both mapped to the url-pattern [/status.ci] which is not permitted

两个类继承了同一个Servlet,改掉之后启动正常

更多推荐

异常记录:Unable to start web server; nested exception is org.springframework.boot.we

本文发布于:2024-03-07 15:55:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1718253.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:异常   web   server   start   nested

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!