This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Spring and the fly likes unable to call  AOP method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "unable to call  AOP method " Watch "unable to call  AOP method " New topic
Author

unable to call AOP method

Rahul Shivsharan
Ranch Hand

Joined: Jun 17, 2009
Posts: 83
Performer.java,



Audience.java



AudienceAdvice.java



bean-cfg-Two.xml


MainPractise24.java



What i am expecting is,
whenever i call perform() method of Performer class, the takeSeats() and turnOffCellPhones() method of Audience class should be called first,
and after execution of method perform(), applause() method of Audience class should be called

but no AOP is happening, the perform method is getting called straight,


even if i changed the eml file to

Rahul Shivsharan
Ranch Hand

Joined: Jun 17, 2009
Posts: 83
Guy's please help me out on this,

i know this question is discussed in this forum,
but that didn't helped me out

Please reply back
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

As per provided files you are using Spring 2.0 configuration, you should Spring 3.0. Please download source code for Spring In Action Third edition & refer to the springidol-annotation project.

http://www.manning.com/walls4/sia3-code.zip

Rahul Shivsharan
Ranch Hand

Joined: Jun 17, 2009
Posts: 83
i got it,
one more configuration was remaining in the xml,
my edited xml file



A proxy creation is also required,

now the above example will run fine with Spring 2.0 config

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

We still recommend that you use the latest Spring version. That way you did it is about 5 years old. Today it is so much easier.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rahul Shivsharan
Ranch Hand

Joined: Jun 17, 2009
Posts: 83
so mark should i start reading "Spring 3.0 In Action" ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Rahul Shivsharan wrote:so mark should i start reading "Spring 3.0 In Action" ?


It is a great book to help learn Spring and the latest version.

Mark
 
 
subject: unable to call AOP method
 
Similar Threads
AOP not getting invoked on my Target Bean Method --> Singer.perform() method
spring AOP doesn't work
Injecting non-Spring beans & Spring AOP not work together?
Advice PointCut methods not being called?
Methods on advice are not being called