1

次の春の 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">

ファイルに次のエラーが表示されます。

ファイル「servlet-context.xml」を介してファイル「spring-mongo-1.0.xsd」を検証すると、以下のエラーが検出されました。ほとんどの場合、これらのエラーは「spring-mongo-1.0.xsd」を直接検証することで検出できます。ただし、spring-mongo-1.0.xsd が servlet-context.xml のコンテキストで検証された場合にのみエラーが発生する可能性があります。

src-resolve: 名前 'repository:repository' を (n) 'type definition' コンポーネントに解決できません 場所: 行 110

プロジェクトは引き続き機能しますが、このエラーを取り除こうとしています。何か案は?

4

1 に答える 1

0

@francadavalによると、解決策はxsdへのリンクを次のように変更することでした。

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

于 2012-10-26T17:10:44.337 に答える