java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found.
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.2.8.RELEASE</version> </dependency>
原因:
\target\projectName\WEB-INF\lib 里面有多个版本的spring-web
解决方法:
全部删除,然后重新build
删掉一个,重新运行tomcat即可,如果在项目的 web-inf 目录的 lib 目录中也存在 不同的两个jar 包,也得删掉一个哦,要不再编译运行的时候还是会加上的。
解决办法(不可行):
在web.xml加一个标签:<absolute-ordering />
<web-app> <display-name>Archetype Created Web Application</display-name> <absolute-ordering></absolute-ordering> </web-app>