jacoco.exec file is generating with 0KB data (On the fly instrumentation)

1,124 views
Skip to first unread message

beingji...@gmail.com

unread,
Mar 21, 2017, 5:09:44 PM3/21/17
to JaCoCo and EclEmma Users
Hi All,

I am quite new to Jacoco and I am planning to integrate Jacoco code coverage tool with my java project which is running under Wildfly application server.

http://www.eclemma.org/jacoco/trunk/doc/agent.html .

I went through the given documentation added Jacoco agent (on the fly instrumentation) with my run script as a JVM parameters.

JAVA_OPTS="$JAVA_OPTS -javaagent:E:/jacoco/jacocoagent.jar=destfile=E:/jacoco/jacoco.exec,includes=*,append=true

Once I run this application , i can see jacoco.exec get generated with 0KB.

I explored further and found that

File System: At JVM termination execution data is written to a local file.

I did not understand clearly what exactly "JVM termination" means?

Is it shutting down the application server? if so, in my case exiting application server is not an option.

I would appreciate any help in this regard.

Thanks.
JT


Marc Hoffmann

unread,
Mar 22, 2017, 3:29:52 AM3/22/17
to jac...@googlegroups.com
Hi,

JaCoCo agent only creates the empty file at startup to ensure the
configured location is actually writable.

By default JaCoCo agent dumps execution data only at shutdown.

To dump execution data at any time (without shutting douwn your
application server) we have two options:

1) Enable JMX (jmx=true) and request the dump via JMX (e.g. with
JConsole)
2) Use output=tcpserver and request a dump with the JaCoCo Maven Goal,
Ant Task or its Java API or use EclEmma to import execution data over
tcp.

Regards,
-marc
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages