2013-02-18 70 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: ...>,並用自動的建議的其它元件。