下面的代码报上面的错误:
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" isolation="DEFAULT" rollback-for="BeanException"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="beanPointcut" expression="execution(* eu.trade.eutn2.backend.bean.business.*BeanImpl (..))"/>
<aop:advisor advice-ref="transactionAdvice" pointcut-ref="beanPointcut"/>
</aop:config>原因是aop:pointcut的expression部分写错,应该是
* eu.trade.eutn2.backend.bean.business.*BeanImpl.*(..))
具体原因不太清楚,在官方文档中没有发现。
本文详细解析了Spring AOP配置中的常见错误,并给出了正确的配置示例。特别关注于表达式的正确书写,帮助开发者避免因配置错误导致的问题。
6624

被折叠的 条评论
为什么被折叠?



