I 'm stuck at the problem that my simple custom java agent don't work correctly.
My custom agent 's purpose is that adding some code fragment to specific classes by Javassist API.
My App started by Jetty.
Firstly, I config jvm options to make jacoco agent correctly such as "-javaagent:[mypath/]jacocoagent.jar".
And then I config jvm options such as "-javaagent:[mypath/]myagent.jar".
It make me confused that my agent only transform the classes from directory of Jetty lib, no one of my application's busness classes is transformed.
I guess the reason is that my app busyness classes and agent classes are loaded by different classloader.
App busyness classes are loaded by webappclassloader of jetty, and agent classed are loaded by sun.misc.Launcher$AppClassLoader.
May I have your text about how jacoco fix the different classloader problem. Thanks.