Jacoco coverage is not coming for jboss deployed application

72 views
Skip to first unread message

vasanthk...@gmail.com

unread,
May 11, 2017, 7:18:32 AM5/11/17
to JaCoCo and EclEmma Users
Hi Team

We have deployed an application to the Jboss node and configured jacoco properties as mentioned below.

JACOCO_PROPERTIES=-javaagent:/mnt/home/devdepft/jacoco/lib/jacocoagent.jar=destfile=/export/home/devdepft/jboss-as/bin/Jacoco_files/TN/jacoco.exec,append=true,includes=*,output=file

when shutdown the node we are getting .exec file with some content inside. however if we try for coverage report it shows 0%.

Could you please help on this.

Java Version: 1.7
Jboss: 5.4
OS=RHEL 6.9

Evgeny Mandrikov

unread,
May 11, 2017, 8:06:47 AM5/11/17
to JaCoCo and EclEmma Users, vasanthk...@gmail.com
Hi,

JaCoCo always creates dump file at startup to guarantee that location is writable. Then it registers standard JVM Shutdown hook ( see http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread) ) that will write all collected information, but whose execution not guaranteed if JVM was not gracefully terminated. So the first thing to check - is that you terminate JBoss gracefully.

Evgeny Mandrikov

unread,
May 16, 2017, 2:06:52 PM5/16/17
to jac...@googlegroups.com, Vasanth Kasirajn
Mailing List was added back to the list of recipients, in future please post message to the group instead of sending private emails.

Make sure that you correctly specify directory with classes during generation of report.
Make sure that you don't have warnings during generation of report.
Make sure that exact same class files are used at runtime and during generation of report - see http://www.jacoco.org/jacoco/trunk/doc/classids.html for more details, in particular:

How can I detect that I have a problem with class ids?

The typical symptom of class id mismatch is classes not shown as covered although they have been executed during the test. This situation can be easily detected e.g. in the HTML report: Open the Sessions page with the link on the top-right corner. You see a list of all classes where execution data has been collected for. Find the class in questions and check whether the entry has a link to the corresponding coverage report page. If the entry is not linked this means there is a class id mismatch between the class used at runtime and the class provided to create the report.


On Mon, May 15, 2017 at 2:01 PM Vasanth Kasirajn <vasanthk...@gmail.com> wrote:
Hi

Thanks for your update.

In our case, We have been doing graceful shutdown both JVM and Jboss. Once we shutdown the JVM we are getting jacoco.exec file around 635kb. However when check for coverage its showing 0%.

We are accessing all the class files before terminate the TVM.



--
Thanks
Vasanth

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