On Friday, March 20, 2020 at 3:58:40 PM UTC+1, fschulte.de.w...@gmail.com 
> Dear Evgeny,,
> this is working and I get coverage data, thanks!
> Now I need a hint on re-deploy of my instrumented war file. In either case 
> jmx or tcpserver the resource is still bound and fails the deploy because 
> of this.
> How can I instruct jacoco to execute the "shutdown()" method for jmx or 
> tcpserver output mode?
> Or is there any other way? A Java Listener that reacts on undeploy to call 
> this shutdown() method?
> Today I need to restart the complete j2ee server to accomplish a second 
> deploy. 

Such "shutdown" method is not exposed as JaCoCo API as you can see in the 
documentation at https://www.jacoco.org/jacoco/trunk/doc/api/index.html

However using reflection in implementation of your listener you can do the 

    Object agent = org.jacoco.agent.rt.RT.getAgent();
    Method shutdownMethod = agent.getClass().getDeclaredMethod("shutdown");
But I'm not sure that this will be enough, because JaCoCo also registers 
JVM shutdown hook.
You can try the following modification
Using the following unofficial build


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 jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to