I am trying to apply aspectj ltw around advice to the java.util.TimeZone class
My first step is just to get AspectJ LTW working so i created a simple aspect:
I added the agent call to my run time parametersCode:@Aspect public class MyTestAspect extends SecurityContextAwareImpl { static Logger logger = Logger.getLogger(MyTestAspect.class); public MyTestAspect() { } @Around("execution(* *.*(..))") public Object test(ProceedingJoinPoint pjp) throws Throwable { System.err.println("hello world"); Object returnValue = pjp.proceed(); return returnValue; } }
I added this tag to my bean configuration:Code:-javaagent:"C:\path to\spring-agent.jar"
Code:<context:load-time-weaver/>
And I added the META-INF/aop.xml file in my classpath and tried various include options just to see if i could get it to work:
When I start my app I get no errors but i never see my "hello world" even though I put calls in TimeZone everywhere. I tried adding:Code:<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"> <aspectj> <weaver options="-verbose -showWeaveInfo"> <include within="java.util.TimeZone"/> </weaver> <aspects> <aspect name="com.mbs.is.model.business.system.MyTestAspect"/> </aspects> </aspectj>
<include within="com.*"/>
It still appears as if my aspect is completely ignored.
I assume I have a configuration problem. What am I missing?


Reply With Quote
