【问题标题】:Spring servlet-context.xml error with mongomongo的Spring servlet-context.xml错误
【发布时间】: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”解决了这个问题。

标签: xml spring mongodb


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-16
    • 1970-01-01
    • 1970-01-01
    • 2017-03-21
    • 2014-07-03
    • 2013-12-30
    • 2012-07-25
    • 2016-09-21
    相关资源
    最近更新 更多