架构URL错误-Spring 3.0

架构URL错误-Spring 3.0,spring,xsd,Spring,Xsd,我正在尝试petcare spring示例程序,但在servlet上下文中出现以下错误 - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/petcare/spring-petcare-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) t

我正在尝试petcare spring示例程序,但在servlet上下文中出现以下错误

- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/petcare/spring-petcare-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>.
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'petcare:resources'.
-schema\u reference.4:无法读取架构文档'http://www.springframework.org/schema/petcare/spring-petcare-3.0.xsd,因为1)无法
查找文档;2) 文件无法读取;3) 文档的根元素不是。
-cvc复杂类型.2.4.c:匹配的通配符是严格的,但找不到元素“petcare:resources”的声明。

spring-petcare-3.0.xsd位于org.springframework.samples.petcare.util.config包的src/main/resources下。如何将URL模式更改为指向此处?

此示例适用于我

您是否正确构建和部署了它?具体来说,您可以检查部署的webapp中是否存在文件
WEB-INF/classes/META-INF/spring.schemas
,其中包含行

http\://www.springframework.org/schema/petcare/spring-petcare-3.0.xsd=org/springframework/samples/petcare/util/config/spring-petcare-3.0.xsd

就是这个,它向webapp指出了xsd文件的位置,这个示例对我来说很有用

您是否正确构建和部署了它?具体来说,您可以检查部署的webapp中是否存在文件
WEB-INF/classes/META-INF/spring.schemas
,其中包含行

http\://www.springframework.org/schema/petcare/spring-petcare-3.0.xsd=org/springframework/samples/petcare/util/config/spring-petcare-3.0.xsd

就是这样,这向webapp表明,在WEB-INF/classes/META-INF下xsd文件的位置不存在。只有application.properties文件。。。在eclipse上,它位于Web文件夹“src/main/webapp/Web-INF”下。。。。。。编辑:否,src/main/resources下存在spring.schema。我使用的是springsource工具套件,因此设置与eclipse有点不同,这是导致problem@sonx-此标记在xsd文件中定义。也许您应该尝试在IDE之外构建和运行它,这是我在WEB-INF/classes/META-INF下所做的,而WEB-INF/classes/META-INF并不存在。只有application.properties文件。。。在eclipse上,它位于Web文件夹“src/main/webapp/Web-INF”下。。。。。。编辑:否,src/main/resources下存在spring.schema。我使用的是springsource工具套件,因此设置与eclipse有点不同,这是导致problem@sonx-此标记在xsd文件中定义。也许您应该尝试在IDE之外构建和运行它,这就是我所做的