Announcement Announcement Module
Collapse
No announcement yet.
@Around("execution(* com.my.myClass.myMethod(..))") does't match method with no param Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Around("execution(* com.my.myClass.myMethod(..))") does't match method with no param

    Hi there,

    I just started trying out Spring AOP (3.x). I have successfully used @Around to match a couple of methods and applied my advice on methods with param and non-null return type.

    Code:
    	@Around("execution(* com.my.myClass.myMethod(..))")
    	public Object myAdvice(ProceedingJoinPoint call) throws Throwable {
              ...
    	}
    But when I tried the same for a method without param, it does not match and my advice is not invoked at all.

    I tried again without two dots between brackets, still not working: com.my.myClass.myMethod()

    I tried on another method which has param but return type is null, again not working.

    Anyone has suggestions? or this is a known bug for Spring?

    Thx
    Chuck

  • #2
    Done some more testing,

    it's strange to see replacing className with *, the advice fires (not for the class I wanted)

    Code:
    	@Around("execution(* com.my.*.myMethod(..))")
    	public Object myAdvice(ProceedingJoinPoint call) throws Throwable {
              ...
    	}
    Is there a limit on how many advice per class? I'm using aspectjrt 1.6.10 with spring 3.x

    thx
    chuck

    Comment

    Working...
    X