得到错误,没有找到元素'jpa:repositories'的声明

Bas*_*sit 3 spring jpa-2.0

我收到以下错误

Line 84 in XML document from class path resource [car-job-app-context.xml] is 
invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 84; 
columnNumber: 154; cvc-complex-type.2.4.c: The matching wildcard is strict, but
no declaration can be found for element 'jpa:repositories'.
Run Code Online (Sandbox Code Playgroud)

这是我的档案

<?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:context="http://www.springframework.org/schema/context"
    xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:repository="http://www.springframework.org/schema/data/repository"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context-3.2.xsd
                        http://www.springframework.org/schema/jdbc
                        http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
                        http://www.springframework.org/schema/data/repository
                        http://www.springframework.org/schema/data/repository/spring-repository.xsd
                        http://www.springframework.org/schema/tx
                        http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
                        http://www.springframework.org/schema/data/jpa
                        http://www.springframework.org/schema/data/jpa/spring-jpa-2.0.xsd" >

.....

<context:annotation-config/>

<context:component-scan base-package="pk.training.basitMahmood.service.impl" />

<jpa:repositories base-package="pk.training.basitMahmood.repository" entity-manager-factory-ref="emf" transaction-manager-ref="transactionManager" />
Run Code Online (Sandbox Code Playgroud)

这是我的maven依赖项的快照

Maven Dependency JARS

我也看到了同样的链接,说移动tx declarationcontext但它不起作用. 与我的问题相同的帖子.我在组合之前和之后尝试过,但错误仍然存​​在.

为什么我收到此错误?我无法在数据库中保存数据....?

谢谢

Rya*_*art 5

命名空间的顺序无关紧要.确保spring-data-jpa工件位于类路径中,并仔细检查模式版本.没有spring-jpa-2.0这样的东西.它应该介于1.0和1.3之间.使用Spring,您通常也可以省略版本并默认获取最新的架构.