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

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

一直報這個錯Attribute 'transaction-manager' is not allowed to appear in element 'tx:advice'

開發(fā)用的集成環(huán)境是intelliJ Idea,課程中引到lib中的jar包全是用maven依賴引進來的,但是這節(jié)課中的com.springsource.org.aopalliance和aspectj.weaver
都會報錯。

正在回答

4 回答

意思很明顯啊 你這個事務通知標簽中沒有transaction-manager這個屬性。你把它的schema加上,看有沒有提示,一般有提示,就不會出錯。



0 回復 有任何疑惑可以回復我~
#1

qq_慕姐8173930 提問者

謝謝,后來得到了解決
2016-10-19 回復 有任何疑惑可以回復我~
#2

東東愛編碼 回復 qq_慕姐8173930 提問者

新手都不容易,我也剛進入不久,學不完的知識,敲不完的代碼。。。
2016-10-19 回復 有任何疑惑可以回復我~

樓主,我把tx的命名空間和標簽連接加進去了,但是有出現(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è)務層類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è)務層類-->
????<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>

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

????<!--配置事務的增強,通過配置通知(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>


0 回復 有任何疑惑可以回復我~

請問是怎么解決的啊


0 回復 有任何疑惑可以回復我~
xmlns:tx="
http://www.springframework.org/schema/cache"
xmlns:tx="http://www.springframework.org/schema/tx"




2 回復 有任何疑惑可以回復我~
#1

qq_慕姐8173930 提問者

謝謝,解決了
2017-02-16 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

一直報這個錯Attribute 'transaction-manager' is not allowed to appear in element 'tx:advice'

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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