【web】Server Tomcat v9.0 Server at localhost failed to start.

本文详细解析了在Tomcat环境下,由于多个名为spring_web的碎片导致的IllegalArgumentException错误。此错误源于Servlet规范中关于相对排序的规定,文章提供了在web.xml中添加特定标签的解决方案,以确保应用正确部署。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错原因:

Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
 at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
 at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
 at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1133)
 at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:774)
 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301)
 at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5056)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
 ... 27 more
<absolut

解决办法:
在web.xml加一个标签:

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值