Spring servlet-context.xml error with mongo



我有以下 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">

并且我在日食中收到文件上的以下错误:

验证文件时检测到以下错误 "spring-mongo-1.0.xsd"通过文件"servlet-context.xml"。 在大多数 这些错误可以通过验证来检测 直接"春天-蒙戈-1.0.xsd"。 但是,错误可能会 仅在上下文中验证 spring-mongo-1.0.xsd 时发生 的 servlet-context.xml。

src-resolve:无法将名称"存储库:存储库"解析为 a(n) "类型定义"组合 位置:第 110 行

该项目仍然有效,但我正在尝试摆脱此错误。有什么想法吗?

根据@francadaval,解决方案是将XSD的链接更改为:

springframework.org/schema/data/mongo/spring-mongo.xsd

最新更新