发现了以元素 'aop:pointcut' 开头的无效内容。应以 '{"http://www.springframework.org/schema/aop":advisor, "http://www.

配置hibernate事务的时候,之前是:

<aop:config>

<aop:pointcut id="myPointcut_keys" expression="bean(taxQueryService)"/>

        <aop:advisor advice-ref="txAdvice_keys" pointcut-ref="myPointcut_keys"/>

        <aop:pointcut id="myPointcut_multi" expression="bean(taxQueryMultiService)"/>
<aop:advisor advice-ref="txAdvice_multi" pointcut-ref="myPointcut_multi"/>
</aop:config>

错误居然是顺序问题,<aop:pointcut>要放在<aop:pointcut>之前,改成如下形式就对了

<aop:config>
<aop:pointcut id="myPointcut_keys" expression="bean(taxQueryService)"/>
<aop:pointcut id="myPointcut_multi" expression="bean(taxQueryMultiService)"/>
<aop:advisor advice-ref="txAdvice_keys" pointcut-ref="myPointcut_keys"/>
<aop:advisor advice-ref="txAdvice_multi" pointcut-ref="myPointcut_multi"/>
</aop:config>



猜你喜欢

转载自blog.csdn.net/earthchinagl/article/details/80327198