aspose file tools*
The moose likes Aspect Oriented Programming and the fly likes Problem with Spring AOP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Bookmark "Problem with Spring AOP" Watch "Problem with Spring AOP" New topic
Author

Problem with Spring AOP

Swaroop Kunduru
Ranch Hand

Joined: May 22, 2006
Posts: 33
I have practicing Spring AOP and took an example from online.

I have the advice and pointcuts are given below

###==================== Before Advice CLASS : BeforeAdvice.java =====================




###==================== Before Advice CLASS : BeforeAdvice.java end =====================



###==================== Before Advice CLASS : ExceptionLoggingAdvice.java Start=====================

###==================== Before Advice CLASS : ExceptionLoggingAdvice.java end =====================

###==================== Before Advice CLASS : MethodPerformanceAdvice.java Start=====================

###==================== Before Advice CLASS : ExceptionLoggingAdvice.java end =====================

And my config file below.




On executing I am getting following error. I suspect the arguments in Before or Around advise.



Please help me understand the problem and the fix to it.

Thanks in advance for your help.

Also Thanks for going over my issue.

Regards,

Swaroop Kunduru.


Regards,
Swaroop Kunduru
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

The serviceCall methods are private, this might be the cause. Make these methods public & try.
Swaroop Kunduru
Ranch Hand

Joined: May 22, 2006
Posts: 33
Thanks for Reply Rishi,

I changed ServiceCall to public method but the error is the same no change.

Regards,

Swaroop Kunduru.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Not sure if this would be your issue, but you have three named pointcuts, all those methods are private, might need to be public, and they all should have different names. You have them all called serviceCall(). Try having different names. and Make sure you update your @Before etc..

Mark


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

Joined: May 22, 2006
Posts: 33
Any one know what it mean in line number 18 in the error log?

Regards,

Swaroop Kunduru.

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Swaroop Kunduru wrote:Any one know what it mean in line number 18 in the error log?

Regards,

Swaroop Kunduru.



This one?

WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ContactsWebApp' did not find a matching property.

Means that ContactsWebApp does not have a setSource method. <property name="source"… means that Spring will call the setSource() method.

Mark>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Spring AOP