2012-11-27 27 views
0

我是Spring的新手,我遇到了我的命名空间问题,它显然涉及到spring-jpa-1.0.xsd。我注意到其他人也有这个。问题在于spring-jpa-1.0.xsd将spring-context的版本硬编码为3.0,但我还没有看到如何解决这个问题的明确解释。我的XML开始如下:spring-jpa-1.0.xsd冲突

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:jpa="http://www.springframework.org/schema/data/jpa" 
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:tx="http://www.springframework.org/schema/tx" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd 
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd 
    http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"> 

我得到的错误是:

The errors below were detected when validating the file "spring-jpa-1.0.xsd" via the file "datasource-tx-jpa.xml". 

我对JPA POM是:

 <dependency> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-jpa</artifactId> 
     <version>1.0.2.RELEASE</version> 
    </dependency> 

我改变了版本

<version>1.1.0.BUILD-SNAPSHOT</version> 

但现在我得到一个失踪的神器错误th在我不知道如何解决。

任何人都知道如何解决这个问题? 感谢

+0

“下面的错误”? –

回答

0

尝试升级到spring-jpa-1.1

的context.xml

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:jpa="http://www.springframework.org/schema/data/jpa" 
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:tx="http://www.springframework.org/schema/tx" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd 
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd 
    http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.1.xsd" 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd"> 

的pom.xml

<dependency> 
    <groupId>org.springframework.data</groupId> 
    <artifactId>spring-data-jpa</artifactId> 
    <version>1.1.0.RELEASE</version> 
    </dependency> 
+0

好的,这摆脱了一个问题,但现在“构建路径不完整”的错误。 – Dave

+0

确保将maven库包含在部署程序集中。 –