Announcement Announcement Module
Collapse
No announcement yet.
Schema based pointcut issues (Spring 3.0.5) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment

      Working...
      X