第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

tx:advice的聲明

我把tx的命名空間和標(biāo)簽連接加進去了,但是有出現(xiàn)了無法發(fā)現(xiàn)元素tx:advice 的異常,具體如下:

Caused by: org.xml.sax.SAXParseException; lineNumber: 47; columnNumber: 71; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但無法找到元素 'tx:advice' 的聲明。


下面是我的spring-config.xml配置文件:

<?xml?version="1.0"?encoding="UTF-8"?>
<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:tx="http://www.springframework.org/schema/tx"
???????xmlns:aop="http://www.springframework.org/schema/aop"
???????xsi:schemaLocation="http://www.springframework.org/schema/beans
???????http://www.springframework.org/schema/beans/spring-beans.xsd
???????http://www.springframework.org/schema/context
???????http://www.springframework.org/schema/context/spring-context.xsd
???????http://www.springframework.org/schema/aop
???????http://www.springframework.org/schema/aop/spring-aop.xsd
???????http://www.springframework.org/schema/tx
???????http://www.springframework.org/schema/tx/spring-tx.xcd
">

????<!--使用自動裝配配置,可以省略定義業(yè)務(wù)層類accountService的bean-->
????<!--<context:component-scan?base-package="com.test.spring.transaction"/>-->

????<!--引入外部屬性文件-->
????<context:property-placeholder?location="classpath:jdbc.properties"/>

????<!--配置c3p0連接池-->
????<bean?id="dataSource"?class="com.mchange.v2.c3p0.ComboPooledDataSource">
????????<property?name="driverClass"?value="${jdbc.driverClass}"/>
????????<property?name="jdbcUrl"?value="${jdbc.url}"/>
????????<property?name="user"?value="${jdbc.username}"/>
????????<property?name="password"?value="${jdbc.password}"/>
????</bean>

????<!--配置業(yè)務(wù)層類-->
????<bean?id="accountService"?class="com.spring.transaction.declarative.serviceImpl.AccountServiceImpl2">
????????<!--<property?name="accountDao"?ref="accountDao"/>-->
????</bean>

????<!--配置dao類,注入c3p0連接池,為dao類加入jdbcTemplate-->
????<bean?id="accountDao2"?class="com.spring.transaction.declarative.daoImpl.AccountDaoImpl">
????????<property?name="dataSource"?ref="dataSource"/>
????</bean>

????<!--配置事務(wù)管理器-->
????<bean?id="transactionManager"?class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
????????<property?name="dataSource"?ref="dataSource"/>
????</bean>

????<!--配置事務(wù)的增強,通過配置通知(advice)-->
????<!--todo?出現(xiàn)tx:advice未被聲明的異常?-->
????<tx:advice?id="txAdvice"?transaction-manager="transactionManager">
????????<tx:attributes>
????????????<tx:method?name="transfer"?propagation="REQUIRED"/>
????????</tx:attributes>
????</tx:advice>

????<!--配置切面-->
????<aop:config>
????????<aop:pointcut?id="pointcut1"?expression="execution(*?com.spring.transaction.declarative.serviceImpl.AccountServiceImpl2.*(..))"/>
????????<aop:advisor?advice-ref="txAdvice"?pointcut-ref="pointcut1"/>
????</aop:config>

</beans>

spring的相關(guān)jar包都是4.3版本的,使用的idea編譯器,編譯時沒有異常。

正在回答

1 回答

xmlns:tx="


http://www.springframework.org/schema/tx

http://www.springframework.org/schema/tx/spring-tx-3.1.xsd


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

浣玉 提問者

非常感謝!
2017-12-17 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

tx:advice的聲明

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號