2013-02-18 77 views
0

而在STS春数据JPA配置与STS

Referenced file contains errors (jar:file:/.../war/WEB-INF/lib/spring- 
context-3.0.RELEASE.jar!/org/springframework/context/config/spring-context-3.0.xsd). 
- Referenced file contains errors (jar:file:/.../war/WEB-INF/lib/spring- 
beans-3.0.RELEASE.jar!/org/springframework/beans/factory/xml/spring-beans-3.0.xsd). 
- Referenced file contains errors (jar:file:/.../war/WEB-INF/lib/spring- 
beans-3.0.RELEASE.jar!/org/springframework/beans/factory/xml/spring-tool-3.0.xsd) 

我得到这个错误在我applicationContext.xml文件这个位置配置Spring数据JPA我得到以下问题。

<?xml version="1.0" encoding="UTF-8"?> 

误差会消失,当我从XML

<beans ...> 

<jpa:repositories ... /> 

标签删除

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

+0

您使用哪个STS版本? – Ralph 2013-02-18 09:53:53

+0

我正在使用STS 3.1 – zdesam 2013-02-18 10:06:22

+0

我也收到警告**无效的NamespaceHandler类[org.springframework.data.jpa.repository.config.JpaRepositoryNameSpaceHandler]为 命名空间[http://www.springframework.org/schema/data/jpa]:处理程序类文件或依赖类出现问题**在 location中 – zdesam 2013-02-18 10:08:11

回答

0

看一看对话框

Window > Preferences > XML > XML CataLog 

1.Click窗口>首选项,然后选择XML> XML目录。

2.单击添加以创建新的商品。

Details: 
Location: D:\...\spring-framework-3.0.5.RELEASE\projects\org.springframework.beans\src\main\resources\org\springframework\beans\factory\xml\spring-beans-3.0.xsd 
Key type: Schema location 
Key:  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 

已在XML文件的一下第路线错误的其他xsd文件必须配置。

3.XML配置如下:

<beans xmlns="http://www.springframework.org/schema/beans" 
    ... 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    ... 
    ..." 
> 

4.Editing <bean: ...>,并用自动的建议的其它元件。