Hi All,
I am new to AOP so apologies if this is trivial - but have done a search and tried a few things out and unfortunately no success.
I'm getting the following exception:
My xml config is:org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.aop.aspectj.AspectJPointcutAdv isor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut
My aspect is:Code:<bean id="requestTimerAspect" class="com.monitor.RequestTimerAspect"/> <aop:config> <aop:aspect id="myAspect" ref="requestTimerAspect"> <aop:pointcut id="myCutTimer" expression="execution(* com.web.OpMonitorController.*())"/> <aop:around pointcut-ref="myCutTimer" method="timer"/> </aop:aspect> </aop:config>
And my test method is:Code:package com.monitor; import org.aspectj.lang.ProceedingJoinPoint; public class RequestTimerAspect { public Object timer(ProceedingJoinPoint call) throws Throwable { System.out.println("before!"); Object retVal = call.proceed(); System.out.println("after!"); return retVal; } }
Can anybody see where I've gone wrong?Code:package com.web; public class OpMonitorController { public void aspectTest(){ System.out.println("Actually in the aspectTest method!!!!"); } }
I have tried this with a couple of different expression values but no success yet, e.g:
Any help would be much appreciated,Code:expression="execution(* com.web.OpMonitorController.*(..))"
Thanks,
Mark


Reply With Quote
