【发布时间】:2012-10-14 08:15:31
【问题描述】:
我有以下 spring servlet-context.xml 文件:
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
我在 Eclipse 中得到以下文件错误:
验证文件时检测到以下错误 “spring-mongo-1.0.xsd”通过文件“servlet-context.xml”。多数情况 在这种情况下,可以通过验证来检测这些错误 “spring-mongo-1.0.xsd”直接。但是也有可能出现错误 只有在上下文中验证 spring-mongo-1.0.xsd 时才会发生 servlet-context.xml。
src-resolve:无法将名称“repository:repository”解析为(n)“类型定义”组件位置:第 110 行
该项目仍然有效,但我正试图摆脱这个错误。有什么想法吗?
【问题讨论】:
-
在其他类似问题中,我看到建议更改为“spring-mongo-1.1.xsd”。我认为它可以避免错误,但在使用 1.0 库版本时它不是正确的解决方案。等待解决方案。
-
我已经用“springframework.org/schema/data/mongo/spring-mongo.xsd”解决了这个问题。