Java mysql的Spring数据xml配置

Java mysql的Spring数据xml配置,java,spring,jpa,spring-data,spring-data-jpa,Java,Spring,Jpa,Spring Data,Spring Data Jpa,我正在尝试用Spring数据和MySql建立一个项目。在使用tomcat部署应用程序时,我遇到以下错误: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:auditing-attributes' to a(n) 'attribute group' component. 我已按如下方式配置了存储库: <jpa:repository base-package="com.navin.

我正在尝试用Spring数据和MySql建立一个项目。在使用tomcat部署应用程序时,我遇到以下错误:

org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:auditing-attributes' to a(n) 'attribute group' component.
我已按如下方式配置了存储库:

<jpa:repository base-package="com.navin.logging.repositories" />

以下是我的xml配置的顶部:

<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">

以下是我的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>

org.springframework.data
spring数据jpa
1.7.1.1发布
javax.persistence
持久性api
1.0.2
org.springframework.data
spring数据共享核心
1.4.1.1发布
org.springframework.data
spring数据共享
1.9.1.发布

非常感谢您的帮助。

公共空间核心依赖项已过时。最好也删除
spring数据共享空间
<代码>spring数据jpa
无论如何都应该引入所有必要的依赖项


小提示:在XML配置文件中使用无版本的XSD声明(即
spring-context.XSD
而不是
spring-context-3.0.XSD
)。如果模式文件在传递过程中包含同一模式文件的其他版本,这将防止发生冲突。

我认为这是不同依赖项版本冲突的结果。升级到everything的最新版本修复了此问题。谢谢@Oliver。使用无版本XSD似乎可以解决这个问题,但我已经升级到了最新版本。