AOP切入点错误

时间:2015-01-16 10:20:14

标签: spring aop

我在我的应用程序中使用AOP并需要定义切入点, 我正在使用spring配置

 <aop:aspect id="aspect" ref="loggerBean">
    <aop:pointcut id="pointCut" expression="execution(public * *(..))"  />
    <aop:around pointcut="pointCut" method="logMethod"  />
 </aop:aspect>

但我得到了例外

Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting '(' at character position 0
pointCut
^

我在这里做错了什么?

1 个答案:

答案 0 :(得分:1)

考虑到您提供的信息,我有两个想法:

  1. 包含logMethod的类是否为@Aspect?
  2. <aop:around pointcut-ref="pointCut" method"logMethod" />请注意 pointcut-ref
  3. 我认为后者是正确的,但现在无法检查。

相关问题