簡體   English   中英

root-context.xml] 無效; 嵌套異常是 org.xml.sax.SAXParseException; cvc-elt.1: 找不到元素 'beans' 的聲明

[英]root-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; cvc-elt.1: Cannot find the declaration of element 'beans'

我在多個問題中看到了同樣的錯誤,並嘗試了每個解決方案。 似乎沒有任何效果。 我修剪了錯誤以便更容易粘貼錯誤在第 7 行的引用中。 這是我的 xml 代碼。 TIA 編輯我添加了調用根上下文的代碼。xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-app_2_5.xsd" 
version="2.5">
<display-name>Subject</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
</web-app>


<?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:util="http://www.springframework.org/schema/util" 
    xmlns:beans="http://www.springframework.org/schema/beans" 
    xsi:schemLocation="
    http://www.springframework.org/schema/util 
    http://www.springframework.org/schema/util/spring-util-3.1.xsd
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">  

<beans:import resource="security-context.xml" /> 
<beans:bean id="subjectProps" 
    class="org.springframework.beans.factory.config.PropertiesFactoryBean"> 
    <beans:property name="locations">
        <beans:list> 
            <beans:value>WEB-INF/spring/subject.properties</beans:value> 
            <beans:value>WEB-INF/spring/subject_sql.properties</beans:value> 
        </beans:list> 
    </beans:property> 
</beans:bean>

<beans:bean id="subjectUtilProperites" 
 class="main.java.mil.serena.subject.common.SubjectProperties"> 
    <beans:property name="properties" ref="subjectProps"/> 
</beans:bean> 
<beans:bean id="publicationUtilProperties" 
  class="main.java.mil.serena.web.common.properties.SubPubProperties"> 
    <beans:property name="properties" ref="subjectProps"/> 
</beans:bean>
</beans>

改變

    xsi:schemLocation="

    xsi:schemaLocation="
             ^

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM