`
cuisuqiang
  • 浏览: 3954284 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
3feb66c0-2fb6-35ff-968a-5f5ec10ada43
Java研发技术指南
浏览量:3665254
社区版块
存档分类
最新评论

Spring JPA 配置文件在Eclipse下报错

    博客分类:
  • SSH
阅读更多

新公司工程是用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">

 

请您到ITEYE网站看 java小强 原创,谢谢!
http://cuisuqiang.iteye.com/ 

自建博客地址:http://www.javacui.com/ ,内容与ITEYE同步!

1
0
分享到:

相关推荐

    SpringMVC+Spring+JPA+Maven框架搭建

    Web页面放置在views目录下,需要在Spring配置文件中配置视图解析器。同时,web.xml文件中需要声明Spring监听器和SpringMVC拦截器,以便管理Web应用的初始化和请求拦截。 二、Maven构建 1. Maven工程说明 Maven...

    java springboot+jpa

    通过在 `pom.xml` 或 `build.gradle` 文件中引入相关依赖,Spring Boot 将自动配置数据源、事务管理器以及 JPA 实现。 ```xml &lt;groupId&gt;org.springframework.boot &lt;artifactId&gt;spring-boot-starter-data-jpa ``...

    spring3.0 + jpa 需要的jar包

    在Java开发中,Spring框架和Java ...不过,实际项目中还可能需要其他依赖,例如Spring的AOP、ORM、Web模块等,以及数据库特定的驱动和JPA的其他实现(如EclipseLink或OpenJPA),具体依赖于项目的需求和配置。

    eclipse mar 创建的简单的spring boot例子,pom无报错

    3. **配置POM.xml**:在POM.xml文件中添加Spring Boot的父POM依赖,以及所需的Starter POMs,比如`spring-boot-starter-web`。 4. **编写主类**:创建一个包含`@SpringBootApplication`注解的类,这是Spring Boot...

    spring-repository-1.6.xsd

    在eclipse中配置jpa的时候,jpa标签有可能会报错,可以加入该xsd文件

    Struts2.1.6+Spring2.5.6+Hibernate3.3.1全注解实例详解(一)

    在这个全注解实例中,我们将深入理解如何利用Struts2.1.6、Spring2.5.6和Hibernate3.3.1构建应用程序,避免传统的XML配置文件,转而采用注解方式来提高开发效率。 **开发环境**: - JDK 1.6.0_18 - Eclipse 3.2.1 -...

    SpringBoot.zip

    6. **零XML配置**:SpringBoot推崇“约定优于配置”,大量减少了XML配置文件的使用,使得代码更加简洁。 接下来,我们将使用Eclipse来创建一个简单的SpringBoot应用: 1. **安装SpringBoot插件**:在Eclipse中,...

    SSH最新框架整合(经典不容错过).pdf

    2. 配置Spring:编写spring的配置文件,如applicationContext.xml,用于管理bean,包括数据源、事务管理等。 3. 配置Hibernate:创建实体类并使用注解进行ORM映射,配置hibernate.cfg.xml文件,指定数据库连接信息。...

    springboot学习视频下载地址

    - **启动报错**:检查配置文件是否有误,确认依赖版本是否兼容。 - **性能优化**:合理配置Spring Boot应用的各项参数,避免不必要的资源消耗。 - **日志管理**:通过配置文件调整日志级别,确保日志记录的合理性。 ...

    SpringBoot新.docx

    在Eclipse中,如果你下载了SpringBoot2.0以上版本并在pom.xml文件中遇到报错,可能是因为Maven Archiver问题。解决方法可以参考相关网址:http://bbs.itmayiedu.com/article/1527749194015。 【快速入门】 1. **...

    SpringBoot整合多数据源

    你需要在项目的`pom.xml`文件中添加Lombok的Maven依赖,并确保Eclipse已经安装了Lombok插件,这样Eclipse才能正确解析Lombok注解。 关于其他文件: - `SpringBoot_Freemarker`:Freemarker是一个模板引擎,可用来...

Global site tag (gtag.js) - Google Analytics