0

春の実行中にエラーが発生します

Unexpected exception parsing XML document from class path resource 
[spring/tx-annotation-app-context.xml]; nested exception 
is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class 
[org.springframework.data.jpa.repository.config.JpaRepositoryNameSpaceHandler] 
for namespace [http://www.springframework.org/schema/data/jpa]: problem with 
handler class file or dependent class; nested exception is 
java.lang.NoClassDefFoundError: 
org/springframework/data/repository/config/RepositoryConfigurationExtension

ここに私のファイルがあります

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

<description>Example configuration to get you started.</description>
    ....
</beans>

これは、含まれているjarのスクリーンショットです

春の瓶

名前空間で何が間違っていますか?

ありがとう

4

1 に答える 1

1

spring-data-commons-coreバージョン 1.1 とspring-data-jpaバージョン 1.2を使用していることが問題だと思います。これらのライブラリのバージョンを合わせます。

私のプロジェクトの 1 つにある pom.xml ファイルを見てください。

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

そしてそれは spring-data-commons-core-1.4.0.RELEASE.jar を使用します

のパッケージspring-data-jpaを pom に切り替えると、必要な依存関係がダウンロードされてから、 に戻されjarます。

于 2013-05-03T08:03:46.583 に答える