当前位置: 首页 > news >正文

解决spring jpa中配置文件报'jpa:repositories'的问题

一、问题描述

    使用spring jpa,报no declaration can be found for element 'jpa:repositories'错误的解决方案

    Multiple annotations found at this line:

- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jpa:repositories'. 
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/data/jpa/spring-jpa.xsd',  

because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

    spring配置文件 

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	xsi:schemaLocation="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
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

二、解决方案

    将http://www.springframework.org/schema/data/jpa/spring-jpa.xsd

    修改为

    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.6.xsd

   注意:

   不添加后面两句,会报:

Referenced file contains errors (http://www.springframework.org/schema/data/jpa/spring-jpa-1.2.xsd). For more information, right click on the 
 message in the Problems View and select "Show Details..."

三、原因分析:

http://www.springframework.org/schema/data/jpa/spring-jpa.xsd

此文件的确不存在,可以在浏览器中进行验证,而http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd

是存在的,估计是spring-jpa-1.3.xsd 代替了spring-jpa.xsd


相关文章:

  • 启用约束时使用exceptions表来跟踪不符合约束的数据并修正
  • Combination Sum系列问题
  • js中容易被忽视的事件问题总结
  • Web Service 接口安全与解决方案
  • B树、B-树、B+树、B*树的定义和区分
  • 史上最全大数据学习资源整理(1)
  • Hive操作表部分总结
  • 电邮欺诈需重视 TurboMail邮件系统保护您
  • IOS-利用AFNetworking监听网络状态
  • WCF学习之旅—WCF服务部署到应用程序(十)
  • 第三节课作业——指针
  • AngularJS 应用身份认证的技巧
  • UDP数据报
  • 实时预测用户对物品偏好 阿里云推荐引擎帮助你更好的提升业务
  • PHPer书单
  • [LeetCode] Wiggle Sort
  • [笔记] php常见简单功能及函数
  • [译]如何构建服务器端web组件,为何要构建?
  • 【Redis学习笔记】2018-06-28 redis命令源码学习1
  • github从入门到放弃(1)
  • JS字符串转数字方法总结
  • MD5加密原理解析及OC版原理实现
  • Spring框架之我见(三)——IOC、AOP
  • Unix命令
  • 看完九篇字体系列的文章,你还觉得我是在说字体?
  • 如何设计一个比特币钱包服务
  • 小程序button引导用户授权
  • 走向全栈之MongoDB的使用
  • TPG领衔财团投资轻奢珠宝品牌APM Monaco
  • !$boo在php中什么意思,php前戏
  • ${factoryList }后面有空格不影响
  • (附源码)springboot宠物管理系统 毕业设计 121654
  • (附源码)springboot家庭装修管理系统 毕业设计 613205
  • (十六)一篇文章学会Java的常用API
  • (算法)Travel Information Center
  • (原創) 如何解决make kernel时『clock skew detected』的warning? (OS) (Linux)
  • (转)Android中使用ormlite实现持久化(一)--HelloOrmLite
  • (转)JAVA中的堆栈
  • (转载)Google Chrome调试JS
  • (转载)在C#用WM_COPYDATA消息来实现两个进程之间传递数据
  • ***linux下安装xampp,XAMPP目录结构(阿里云安装xampp)
  • **PyTorch月学习计划 - 第一周;第6-7天: 自动梯度(Autograd)**
  • .NET Compact Framework 3.5 支持 WCF 的子集
  • .net Stream篇(六)
  • .NET 中选择合适的文件打开模式(CreateNew, Create, Open, OpenOrCreate, Truncate, Append)
  • [ Linux 长征路第二篇] 基本指令head,tail,date,cal,find,grep,zip,tar,bc,unname
  • [ vulhub漏洞复现篇 ] Apache APISIX 默认密钥漏洞 CVE-2020-13945
  • [383] 赎金信 js
  • [BUUCTF NewStarCTF 2023 公开赛道] week4 crypto/pwn
  • [BZOJ 4598][Sdoi2016]模式字符串
  • [C#] 基于 yield 语句的迭代器逻辑懒执行
  • [C#]OpenCvSharp结合yolov8-face实现L2CS-Net眼睛注视方向估计或者人脸朝向估计
  • [C/C++]数据结构 堆的详解
  • [COI2007] Sabor
  • [Docker]四.Docker部署nodejs项目,部署Mysql,部署Redis,部署Mongodb