This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Advice PointCut methods not being called? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Advice PointCut methods not being called?" Watch "Advice PointCut methods not being called?" New topic

Advice PointCut methods not being called?

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
I have no idea, why AudienceAdvice joinpoint methods are not being called.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
<bean id="kenny" class="Instrumentalist">
<property name="instrument" ref="instrument"></property>
<bean id="instrument" class="Saxophone"></bean>

<bean id="audience" class="Audience"></bean>
<bean id="audienceadvice" class="AudienceAdvice">
<property name="audience" ref="audience"></property>

<bean id="audiencearoundadvice" class="AudienceAroundAdvice">
<property name="audience" ref="audience"></property>

<bean id="performancePointCut" class="">
<property name="pattern" value=".*"></property>

<bean id="audienceAdvisor" class="">
<property name="advice" ref="audienceadvice"></property>
<property name="pointcut" ref="performancePointCut"></property>

<bean id="audienceAdvisor1" class="">
<property name="advice" ref="audienceadvice"></property>
<property name="pattern" value=".*perform"></property>

SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog-
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Finally i got it solved.

[Removed not nice comment. Mark Spritzler]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

FYI, it looks like you are testing out the code from the Spring in Action book. And to let you know that that book is based mostly on Spring 2.0 version. While a lot of that book is still relevant, some of the examples are "older" way of doing things.

For instance in your Advice class, you are now tied to Spring because of the interfaces that you implemented. Where the more POJO clean way is to create a class and add either xml aop tags to declare your joinpoints or with Annotations. This keeps your "Aspect" class a pure Java object.

Here is the xml way

And here is the Annotation way

Good Luck


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Advice PointCut methods not being called?
Similar Threads
Spring AOP aspect not working.
AOP not getting invoked on my Target Bean Method --> Singer.perform() method
Methods on advice are not being called
spring AOP doesn't work
unable to call AOP method