2013-04-23 26 views
0

我的Spring配置文件是這樣的CVC-複雜type.2.4.c:匹配通配符是嚴格的,但沒有聲明可以發現元素「UTIL:性能」

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:util="http://www.springframework.org/schema/util" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" 
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-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/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> 
. 
. 
. 
<util:properties id="mailProperties"> 
     <prop key="mail.smtp.auth">${mail.smtp.auth}</prop> 
     <prop key="mail.smtp.starttls.enable">${mail.smtp.starttls.enable}</prop> 
     <prop key="mail.smtp.quitwait">${mail.smtp.quitwait}</prop> 
     <prop key="mail.smtp.debug">${mail.smtp.debug}</prop> 
    </util:properties> 

我得到以下在配置xml文件

schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/util/spring-util-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>. 

錯誤讓我知道需要做

+0

你使用的是什麼版本的彈簧? 它與xsi:schemaLocation中的版本號是否匹配? – 2014-03-06 17:01:32

回答

0

嘗試所有的.xsd面前擺脫-3.0什麼。 我遇到了這個愚蠢的錯誤,並刪除版本工作版本號已爲我工作。

我不能告訴你爲什麼這個工程。如果您在org.springframework.beans-3.1.2.jar(例如)尋找並找到META-INF/spring.schemas你會發現所有的這些


http\://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd 
http\://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd 
http\://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd 
http\://www.springframework.org/schema/util/spring-util-3.1.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd 
http\://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd 

你會發現那裏架構所以爲什麼XML解析器抱怨對我來說是個謎。

相關問題