aspose file tools*
The moose likes Aspect Oriented Programming and the fly likes After Advice not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Bookmark "After Advice not working" Watch "After Advice not working" New topic
Author

After Advice not working

Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 202

Hi ranchers ,
I am trying a small example of After advice. I am having following class


I have following spring configuration :


And when i invoke hello() , the after advice method i.e bye() does not get invoked. Can someone please help me where exactly have i made mistake as this is very basic and as i have just started with spring.

Regards,
Shroff.


OCJP-90%,OCPWCD-95%
Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 202

Will be really helpful to me if someone can help me understand why my advice method is not getting called.

Regards,
Shroff.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

If you are going to use Spring interface based proxying for your AOP then you need to code to interfaces, and invoke the aspect through the interface for the proxy to be there and your advice to be executed.


[How To Ask Questions][Read before you PM me]
 
Don't get me started about those stupid light bulbs.
 
subject: After Advice not working
 
Similar Threads
aop and transations
java.lang.IllegalArgumentException: The input() is not defined in action class $Proxy262
unable to Apply Aspects to simpleformcontroller class methods
Hello world spring aop
Problem with Spring AOP+AspectJ