File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Spring AOP

 
Swaroop Kunduru
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The serviceCall methods are private, this might be the cause. Make these methods public & try.
 
Swaroop Kunduru
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Swaroop Kunduru
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any one know what it mean in line number 18 in the error log?

Regards,

Swaroop Kunduru.

 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic