Spring JPA配置文件Eclipse报错如何解决

作者:cuisuqiang 时间:2022-05-07 00:51:34 

新公司工程是用Maven管理的,技术上使用了JPA,但是我导入工程到MyEclipse时,applicationContext.xml中提示错误:

Referenced file contains errors (http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd)

网上说需要用到:

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

于是对配置文件少做修改,不报错,可以运行,修改后的配置文件头如下:


<?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:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
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/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.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-1.3.xsd
http://www.springframework.org/schema/data/repository
http://www.springframework.org/schema/data/repository/spring-repository-1.5.xsd
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.2.xsd"
default-lazy-init="true">

来源:https://www.iteye.com/blog/cuisuqiang-2053682

标签:Spring,JPA,配置,文件,Eclipse
0
投稿

猜你喜欢

  • SpringBoot使用AOP与注解实现请求参数自动填充流程详解

    2022-08-18 17:30:36
  • Java7到Java17之Switch语句进化史示例详解

    2021-11-03 18:47:37
  • 关于Java中的IO流总结(推荐)

    2023-08-23 18:13:56
  • Spring Boot 工程的创建和运行(图文)

    2022-06-26 15:39:49
  • MyBatis-Plus 如何单元测试的实现

    2022-03-02 19:45:08
  • Springboot @Validated和@Valid的区别及使用详解

    2023-05-30 18:40:25
  • Spring Batch批处理框架使用解析

    2021-12-24 03:41:19
  • SpringBoot配置文件中数据库密码加密两种方案(推荐)

    2023-03-16 22:40:55
  • Java开发Oracle数据库连接JDBC Thin Driver 的三种方法

    2022-05-08 09:40:50
  • SpringBoot自动配置深入探究实现原理

    2023-08-06 09:59:58
  • Intellij IDEA 配置Subversion插件实现步骤详解

    2023-11-03 10:09:04
  • MyBatis动态SQL标签用法实例详解

    2023-11-26 01:04:27
  • flutter中的资源和图片加载示例详解

    2023-08-24 13:19:39
  • 关于线程池你不得不知道的一些设置

    2021-06-08 11:34:45
  • java 中接口和抽象类的区别与对比

    2022-07-09 04:13:03
  • 详解Maven settings.xml配置(指定本地仓库、阿里云镜像设置)

    2022-04-09 23:45:14
  • java开发ShardingSphere的路由引擎类型示例详解

    2023-11-29 01:18:56
  • java实现上传图片并压缩图片大小功能

    2023-06-14 22:32:35
  • Java面试题之基本语法(图解)

    2023-11-24 09:37:34
  • VS2019配置opencv详细图文教程和测试代码的实现

    2023-07-17 13:49:31
  • asp之家 软件编程 m.aspxhome.com