2017-11-14 24 views
0

私のプロジェクトでSpringトランザクションを使用しようとしています。 XMLSpringトランザクションマネージャ:cvc-complex-type.2.4.c:一致するワイルドカードは厳密ですが、要素 'tx:annotation-driven'の宣言が見つかりません

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

<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:security="http://www.springframework.org/schema/security" 
     xmlns:context="http://www.springframework.org/schema/context" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" 
     xmlns:tx="http://www.springframework.org/schema/tx" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-4.1.xsd 
      http://www.springframework.org/schema/security 
      http://www.springframework.org/schema/security/spring-security-4.0.xsd 
      http://www.springframework.org/schema/context 
      http://www.springframework.org/schema/context/spring-context-4.1.xsd 
      http://www.springframework.org/schema/tx 
      http://www.springframework.org/schema/tx/spring-tx-4.1.xsd"> 
    <tx:annotation-driven /> 
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
     <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /> 
     <property name="url" value="jdbc:oracle:thin:@xyz:1521:orcl" /> 
     <property name="username" value="TESTSPRING" /> 
     <property name="password" value="TESTSPRING" /> 
    </bean> 
    <bean id="transactionManager" 
      class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> 
     <property name="dataSource" ref="dataSource" /> 
    </bean> 
</beans> 

次けどspring-txのための依存関係を追加し、サーバーの起動時に

Caused by: org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 29; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'. 

答えて

0

を、次のエラーを取得しています。下に依存関係を追加するpom.xml

<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-tx</artifactId> 
    <version>4.1.1.RELEASE</version> 
</dependency> 
関連する問題