2014-11-13 3 views
0

스프링 데이터 및 MySql을 사용하여 프로젝트를 설정하려고합니다.MySQL 용 스프링 데이터 xml 구성

org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:auditing-attributes' to a(n) 'attribute group' component. 

을 다음과 같이 나는 저장소를 구성 :

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 
xmlns:mongo="http://www.springframework.org/schema/data/mongo" 
xmlns:mvc="http://www.springframework.org/schema/mvc" 
xmlns:jpa="http://www.springframework.org/schema/data/jpa" 
xsi:schemaLocation="http://www.springframework.org/schema/mvc 
     http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
     http://www.springframework.org/schema/context 
     http://www.springframework.org/schema/context/spring-context-3.0.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/beans 
     http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://www.springframework.org/schema/data/jpa 
     http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"> 
: 여기
<jpa:repository base-package="com.navin.logging.repositories" /> 

내 XML 설정의 선두입니다 바람둥이로 응용 프로그램을 배포하는 동안 나는 다음과 같은 오류로 실행 해요

다음은 내 Maven 종속성입니다.

<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-jpa</artifactId> 
    <version>1.7.1.RELEASE</version> 
</dependency> 
<dependency> 
    <groupId>javax.persistence</groupId> 
    <artifactId>persistence-api</artifactId> 
    <version>1.0.2</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-commons-core</artifactId> 
    <version>1.4.1.RELEASE</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-commons</artifactId> 
    <version>1.9.1.RELEASE</version> 
</dependency> 

도움을 주시면 감사하겠습니다.

+0

다른 종속성의 충돌하는 버전의 결과라고 생각합니다. 모든 문제를 해결 한 최신 버전으로 업그레이드하십시오. –

답변

0

…-commons-core 종속성은 사용되지 않습니다. 심지어 더 나은 spring-data-commons을 제거하십시오. spring-data-jpa 어쨌든 필요한 모든 종속성을 끌어 와야합니다.

보조 팁 : XML 설정 파일에서 버전이없는 XSD 선언을 사용하십시오 (즉, spring-context-3.0.xsd 대신 spring-context.xsd). 이렇게하면 스키마 파일에 동일한 스키마 파일의 다른 버전이 일시적으로 포함될 경우 충돌이 발생하지 않습니다.

+0

고맙습니다 @ 올리버. 버전이없는 XSD를 사용하여 문제를 해결하는 것처럼 보였지만 어쨌든 최신 버전으로 업그레이드했습니다. –