File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Problem with setting the Pointcut and advice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Problem with setting the Pointcut and advice" Watch "Problem with setting the Pointcut and advice" New topic

Problem with setting the Pointcut and advice

jigar babaria

Joined: Jun 04, 2010
Posts: 7
I am trying AOP for the first time. I have define the following bean:

<bean id="audienceAdvisor" class="">
<property name="advice" ref="audienceAdvice">
<property name="pointcut" ref="performancepointcut">

Here ref "audienceAdvice" is the bean that implements MethodInterceptor interface & ref "performancePointcut" is a bean with class ""
While running the program I am getting the following error message:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'audienceAdvisor' defined in file [F:\Eclipse\eclipse\workspace\First Spring Project\bean.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice

It looks like error is related to the propery "advice" of the above bean.(Not sure). I have also added the "aopalliance-alpha1.jar in my classpath.

Can someone please help me out with this problem?

Jigar Babaria

It is sorta covered in the JavaRanch Style Guide.
subject: Problem with setting the Pointcut and advice
Similar Threads
spring AOP doesn't work
unable to call AOP method
Advice PointCut methods not being called?
why 'value' for interceptorNames instead of 'ref'
Methods on advice are not being called