Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Unable to dump coverage data

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I am trying to run the generateDump target of the build file, but all I get is the following error

generateDump:
[jacoco:dump] Connecting to localhost/127.0.0.1:1001

BUILD FAILED
C:\Users\DGM(IT)\Downloads\Compressed\JaCoCo_KT\JaCoCo_KT\JaCoCo_ANT.xml:15: Unable to dump coverage data

Total time: 0 seconds


The file builds successfully when I run the command
ant -buildfile C:/Users/DGM(IT)/Downloads/Compressed/JaCoCo_KT/JaCoCo_KT/JaCoCo_ANT.xml

What could be the possible reasons why the generateDump target won't work?

I am using jboss-4.2.3. I have added the following jvm option to the run.conf file.
set JAVA_OPTS="%JAVA_OPTS% -javaagent:C:/Users/DGM(IT)/Downloads/Compressed/jacoco-0.7.7.201606060606/lib/jacocoagent.jar=output=tcpserver,port=1001"


This is my xml file.



<?xml version="1.0" encoding="UTF-8"?>
<project name="Example" default="" xmlns:jacoco="antlib: org.jacoco.ant">

<taskdef uri="antlib: org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="C:/Users/DGM(IT)/Downloads/Compressed/jacoco-0.7.7.201606060606/lib/jacocoant.jar"/>
</taskdef>

<property name="reportLocation" value="${reportLocation}" />
<property name="solutionName" value="${solutionName}" />
<property name="dumpLocation" value="${dumpLocation}"/>
<property name="type" value="${type}"/>
<property name="location" value="${location}"/>

<target name="generateDump">
<jacoco:dump port="1001" destfile="D:/JaCoCoJar/Dump/coverage.exec"/>
</target>

<target name="generateReport">

<jacoco:report>

<executiondata>
<file file="D:/JaCoCoJar/Dump/coverage.exec"/>
</executiondata>

<structure name="FirstCodeCoverage">
<classfiles>
<fileset dir="C:/Users/DGM(IT)/workspace">
<include name="mfg.jar"/>
</fileset >
</classfiles>
</structure>

<html destdir="D:/JaCoCoJar/Dump/coverage.html"/>
<xml destfile="D:/JaCoCoJar/Dump/coverage.xml"/>

</jacoco:report>
</target>
</project>
 
Ranch Hand
Posts: 353
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's more related to jacoco issue than ant.
So can you execute jacoco outside of ant ?
(and replicate the error)
 
Tamasa Patra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I am able to run jacoco outside ant. The coverage.exec file is generated by adding the jvm option (in cmd)
java -javaagent:C:/Users/DGM(IT)/Downloads/Compressed/jacoco-0.7.7.201606060606/lib/jacocoagent.jar=destfile=D:/JaCoCoJar/Dump/coverage.exec,includes=*,append=true,output=file
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!