Spring JPA配置文件Eclipse報錯如何解決
新公司工程是用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.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsdhttp://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsdhttp://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsdhttp://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsdhttp://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'>
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。
相關文章:
1. React+umi+typeScript創建項目的過程2. .Net core 的熱插拔機制的深入探索及卸載問題求救指南3. ASP調用WebService轉化成JSON數據,附json.min.asp4. SharePoint Server 2019新特性介紹5. 三個不常見的 HTML5 實用新特性簡介6. 解決ASP中http狀態跳轉返回錯誤頁的問題7. ASP中常用的22個FSO文件操作函數整理8. 無線標記語言(WML)基礎之WMLScript 基礎第1/2頁9. ASP.NET Core 5.0中的Host.CreateDefaultBuilder執行過程解析10. ASP編碼必備的8條原則
