Java 在tomcat上部署SpringWeb应用程序时出现问题

Java 在tomcat上部署SpringWeb应用程序时出现问题,java,spring,eclipse,spring-mvc,tomcat,Java,Spring,Eclipse,Spring Mvc,Tomcat,我尝试使用Eclipse IDE在tomcat上部署一个简单的spring web应用程序,但在服务器上运行该应用程序时遇到以下异常: 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 specifi

我尝试使用Eclipse IDE在tomcat上部署一个简单的spring web应用程序,但在服务器上运行该应用程序时遇到以下异常:

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.
我搜索发现,我必须在“web.xml”中的显示名称后面使用绝对排序标记,但它对我不起作用。 我还换了很多次弹簧罐,我认为我的弹簧罐已经损坏了

我试图清理tomcat和web目录,但没有任何效果

web.xml:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
                      http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
  version="4.0">
   <display-name>spring_mvc_1</display-name>
   <absolute-ordering />
   <!-- Spring MVC Configs -->
   <!-- Step 1: Configure Spring MVC Dispatcher Servlet -->
   <servlet>
      <servlet-name>dispatcher</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <init-param>
         <param-name>contextConfigLocation</param-name>
         <param-value>/WEB-INF/spring-mvc-demo-servlet.xml</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
   </servlet>
   <!-- Step 2: Set up URL mapping for Spring MVC Dispatcher Servlet -->
   <servlet-mapping>
      <servlet-name>dispatcher</servlet-name>
      <url-pattern>/</url-pattern>
   </servlet-mapping>
</web-app>

你能发布你的pom.xml吗?@AvijitBarua,我手动包含jar,我不使用maven,我通过spring repo下载了它们。@你能发布你的jar列表的截图吗?@AvijitBarua我编辑了帖子并添加了jar列表。它是tomcat 8.5,我移动到了tomcat 9,它成功了!!
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd">

    <!-- Step 3: Add support for component scanning -->
    <context:component-scan base-package="com.app.controller" />

    <!-- Step 4: Add support for conversion, formatting and validation support -->
    <mvc:annotation-driven/>

    <!-- Step 5: Define Spring MVC view resolver -->
    <bean
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/view/" />
        <property name="suffix" value=".jsp" />
    </bean>

</beans>
package com.app.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageController {
    @RequestMapping("/")
    public String showPage() {
        return "mainPage";
    }
}