CVC-复杂type.2.4.c:匹配通配符是严格的,但没有声明可以发现元素“UTIL:性能”
问题描述:
我的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>.
错误让我知道需要做
答
尝试所有的.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解析器抱怨对我来说是个谜。
你使用的是什么版本的弹簧? 它与xsi:schemaLocation中的版本号是否匹配? – 2014-03-06 17:01:32