<Jul 22, 2015 7:00:00 PM IST> <Error> <HTTP> <BEA-101216> <Servlet:
 "dispatcher" failed to preload on startup in Web application: "test".

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自ServletContext资源[/WEB-INF/classes/dispatcher-servlet.xml]的XML文档中的第31行无效;嵌套异常是org.xml.sax.SAXParseException:cvc-complex-type.2.4.a:找到以元素'bean'开头的无效内容 . 预计会有一个'{“http://www.springframework.org/schema/mvc":mapping}' .

我在启动应用程序时收到以上异常,请在下面找到我的 spring 配置 .

xmlns:context="http://www.springframework.org/schema/context"

        xmlns:mvc="http://www.springframework.org/schema/mvc"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xmlns:aop="http://www.springframework.org/schema/aop"

        xsi:schemaLocation="   http://www.springframework.org/schema/beans  

           http://www.springframework.org/schema/beans/spring-beans-4.0.xsd   

             http://www.springframework.org/schema/context   

               http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc 

    http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd

    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">


        <mvc:interceptors>

                    <mvc:interceptor>

                                <bean name="cachingHeadersInterceptor" class="com.testcompany.test.interceptors.CacheInterceptor"/>

                    </mvc:interceptor>

        </mvc:interceptors>

当我更换下面的拦截器时,我的应用程序工作正常

<mvc:interceptors>

                                <bean name="cachingHeadersInterceptor" class="com.testcompany.test.interceptors.CacheInterceptor"/>

        </mvc:interceptors>

帮我改正配置 .