Stack Exchange
Spring Aspectj LoadTimeWeaving is not working
I have a problem weaving an aspect using AspectJ LoadTimeWeaving
Here is the aspect:
package com.thomson.tgr.aspects;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.util.StopWatch;

@Aspect
public class PerformanceAspect {

@Around("methodsToBeProfiled()")
public Object profile(ProceedingJoinPoint pjp) throws Throwable {
    StopWatch sw = new StopWatch(getClass().getSimpleName());
    try {
        sw.start(pjp.getSignature().getName());
        return pjp.proceed();
    } finally {
        sw.stop();
        System.out.println("asdfasdf" + sw.prettyPrint());
    }
}

@Pointcut("execution(* *.*(..))")
public void methodsToBeProfiled(){}

}
here is the aop.xml
<!DOCTYPE aspectj PUBLIC
    "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">


<weaver options="-verbose -debug -showWeaveInfo">        
    <include within="com..*"/>

</weaver>

<aspects>

    <!-- weave in just this aspect -->
    <aspect name="com.xxx.tgr.aspects.PerformanceAspect"/>

</aspects>


I've added 
<context:load-time-weaver /> 

to my beans definition.
and i added 
-javaagent:"C:/Users/UC193514/Desktop/aspectjweaver-1.7.0.jar"
-javaagent:"C:/Users/UC193514/Desktop/spring-instrument-3.2.7.RELEASE.jar"

To the JVM arguments.
all what i can see related to weaving in my log is:
[WebappClassLoader@1ce4a8a] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified

no class has been weaved.
Did i miss anything??

You can only specify a single javaagent afaik, not multiple. Also the warning states that the default idk classes will not be weaved. Depending on the server you don't need the agent and only @EnableLoadtimeWeaving or <context:loadtime-weaving />.

@M.Deinum Thanks, Actually i have tried to use single agent and didnt work, i've read some articles which say that both agents should be used. i am using Tomcat server, deploying from Eclipse
