3

Eclipse/STS は、Spring 3.2.1 と Spring-data-jpa を一緒に使用するとエラーを報告します。次のヘッダーを持つ XML 構成ファイルがいくつかあります。

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/data/jpa
    http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">

私はSpring-Data-JPA 1.3.0でSpring 3.2.1を使用しており、Eclipse/STSはこれを報告しています:

参照ファイルにエラーがあります ( http://www.springframework.org/schema/data/jpa )

これは、data-jpa スキーマを含むすべての XML 構成ファイルで発生します。XML構成からJPAを削除すると、すべて問題ありません。

私の設定が間違っているのですか、それともここで何が起こりますか?

ありがとう!ポール

4

1 に答える 1

7

現在、 http://www.springframework.org/schema/data/jpa/spring-jpa.xmlファイルがないため、 http://www.springframework.org/schema/data/jpa/spring-を使用する必要があります。 jpa-1.3.xsdですが、このファイルは存在しないhttp://www.springframework.org/schema/data/repository/spring-repository.xsdを使用するため、コンテキスト ファイルにこのスキーマの場所を追加する必要があります。 :

xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans.xsd
                    http://www.springframework.org/schema/jdbc
                    http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
                    http://www.springframework.org/schema/data/jpa
                    http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
                    http://www.springframework.org/schema/data/repository
                    http://www.springframework.org/schema/data/repository/spring-repository-1.5.xsd
                    http://www.springframework.org/schema/jee
                    http://www.springframework.org/schema/jee/spring-jee-3.2.xsd"
于 2013-07-26T04:12:55.863 に答える