我正在尝试petcare spring示例程序,但我在servlet-context中得到以下错误
- 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'.
spring-petcare-3.0.xsd位于 src / main下的 org.springframework.samples.petcare.util.config 包中/资源 即可。如何将URL架构更改为指向此处?
答案 0 :(得分:1)
样本适合我。
您是否正确构建和部署了它?具体来说,您可以检查部署的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文件的位置