报告不正确的方面和切入点。 当某些 AOP 建议与方面 bean 匹配时,可能会导致运行时错误。
示例:
<beans >
<aop:config>
<aop:pointcut expression="args()"/> <!-- 切入点应具有 ID -->
<aop:aspect/> <!-- 应定义 'ref' 特性 -->
</aop:config>
</beans>
<beans>
<bean id="aspect1" class="Aspect1"/>
<bean id="aspect2" class="Aspect2"/>
<aop:config>
<aop:aspect ref="aspect1"> <!-- 一些建议与此 Bean 匹配 -->
<aop:before method="xxx" pointcut="execution(* foo())"/>
</aop:aspect>
<aop:aspect ref="aspect2">
<aop:before method="xxx" pointcut="execution(* foo())"/>
</aop:aspect>
</aop:config>
</beans>