Results 1 to 3 of 3

Thread: Schema based pointcut issues (Spring 3.0.5)

  1. #1
    Join Date
    May 2011
    Posts
    3

    Default Schema based pointcut issues (Spring 3.0.5)

    Encountering two issues:
    1) if I put the word "not" at the beginning of a pointcut expression I get an error but the bang (!) works fine.
    <aop:after-returning method="doSomething" pointcut="not target(com.Bar)"/>
    <aop:after-returning method="doSomething" pointcut="!target(com.Bar)"/>

    2) if i put a "not" (regardless of whether I use the bang or the word) in a pointcut sub-expression the entire expression fails to ever match.

    <aop:after-returning method="doSomething" pointcut="target(com.Foo) and not target(com.Bar)"/>

    I cannot use annotations to do this because the "doSomething" method is in a class that I do not have access to (in a utility jar).

    What am I missing?

  2. #2
    Join Date
    May 2011
    Posts
    7

    Default

    I wanted to add, this problem appears for us (jaweitlauf and myself) to happen primarily when using target, @target, or @within in a compound statment with negation.

    For example:

    pointcut="target(some.Target) and bean(somebeanName)" works fine

    but

    pointcut="target(some.Target) and not bean(somebeanName)" will not work as expected

    I think this issue is the same as: https://jira.springsource.org/browse/SPR-5439 and I have posted there as well. If anyone knows of a suitable work around or solution, please post it.

  3. #3
    Join Date
    May 2011
    Posts
    7

    Default

    I believe I have found a workaround. See below:

    within(@the.type.Annotation *) and !bean(notwanted*)

    This appears to do what I need without using target. There may be other issues, but I have not seen them yet.

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
  •