Spring中XML配置AOP出现错误

Spring中AOP配置XML出现错误

首先看aplicationContext配置是否正确

首先说个细节,希望能帮助大家节约时间!
Spring中XML配置AOP出现错误
<aop:pointcut expression=“execution(* com.laofuzi.product.productImpl.save(…))” id=“pointcut001”/>
execution后*号要与com…之间要有一个空格否则会报错
编写的切面类以及要是实例化的记得交给spring管理


注意ref要与对呀的id匹配。
Spring中XML配置AOP出现错误

jar包要引对

6个核心jar包

Spring中XML配置AOP出现错误
4个AspectJ需要的jar包
Spring中XML配置AOP出现错误
加上测试需要的包一共是十一个
Spring中XML配置AOP出现错误
还有abblicationContext要再Src下