Results 1 to 2 of 2

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

  1. #1
    Join Date
    Nov 2011
    Posts
    4

    Default @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. #2
    Join Date
    Nov 2011
    Posts
    4

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •