1

我在 Eclipse 中的项目中将这个错误添加到我的 XML 文件中:

Multiple annotations found at this line:
    - cvc-elt.1: Cannot find the declaration of element 'beans'.
    - schema_reference.4: Failed to read schema document 'http://
     www.springframework.org/schema/beans/spring-beans-3.0.xsd', because 1) could not find the 
     document; 2) the document could not be read; 3) the root element of the document is not 
     <xsd:schema>.

当我只写一个空格然后保存文件时,错误消失了,但在它再次返回之后。任何想法?谢谢


这是我的 XML 文件的内容

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">

    <mvc:annotation-driven />   
    <context:component-scan base-package="gestion.delegation.controller" />
    <bean       class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/pages/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
    <bean id="AddUserValidator" class="gestion.delegation.validator.AddUserValidator" />
</beans>    
4

0 回答 0