spring 事务管理配置文件报错

报错信息:the matching wildcard is strit,but no declation can be found for element"tx:advise"
三个都是这样
<beans xmlns:a="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/spring-tx-2.0.xsd
">这是所有的命名空间

首先的在最上面加上aop和tx 命名空间
<!-- 配置hibernate事务管理器 -->
<bean id="TransManger" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- 配置事务特性 -->
<tx:advice id="Transtx" transaction-manager="TransManger">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="find*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 使用aop 注入 -->
<aop:config>
<aop:pointcut id="pService" expression="execution(* com.qdc.service.*.*.*(..))"/>
<aop:advisor advice-ref="Transtx" pointcut-ref="pService"/>
</aop:config>
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网