Hi,

a Java agent should see all classes loaded by the JVM, even when different 
class loaders are used. Therefore JaCoCo has no special code to get all classes 
instrumented.

Regards,
-marc


> On 19. Mar 2020, at 18:50, [email protected] wrote:
> 
> Dear Jacoco Team,
> 
> 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.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/7d86db7c-d85a-42f2-9d20-b1f93650aadf%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/B6FE363B-E9CD-481D-A2FD-BCE9B3DDD142%40mountainminds.com.

Reply via email to