/ /要素 'tx:annotation-driven'の宣言が見つかりません - java、xml、spring、xsd、spring-transactions

'tx:annotation-driven'要素の宣言は見つかりません - java、xml、spring、xsd、spring-transactions

私は私のプロジェクトに春4.1.1を使用しています。私は次の例外を受け取ります。私が使用している定義は以下のとおりです、助けが必要です!

xmlns:tx="http://www.springframework.org/schema/tx"
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd"

回答:

回答№1は1

クラスパスにspring-tx依存関係があることを確認してください。 mavenを使用している場合は、依存関係を追加してください

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>

すでに依存関係がある場合はバージョンが4.1ではないことを確認してください。

バージョンを省略して名前空間を宣言し、常に最新のものを選択することもできます

xmlns:tx="http://www.springframework.org/schema/tx"
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd"

バージョンに固有の機能が本当に必要な場合は、バージョンを指定してください