Hi,
I am getting 'java.io.IOException: Unknown block type 0' issue during Jacoco 
ant build.
I tried with windows command prompt and jenkins ant build as well. Encountered 
same issue intermittently.

I am using following jars and versions. 
jacocoagent --> 0.8.3
jacocoant --> 0.8.3
java --> 1.8
ant --> 1.10.5

Sometimes i am not getting any issues. Most of the time i am facing this issue. 
If you see my first run, i got an issue. In the second run i don't find any 
issues. 
Can you please let me know the reason of this issue. How to get out of it?

First Run:
C:\jacoco_new>ant -v report
Apache Ant(TM) version 1.10.5 compiled on July 10 2018
Trying the default build file: build.xml
Buildfile: C:\jacoco_new\build.xml
Detected Java version: 1.8 in: C:\Program Files\Java\jdk1.8.0_201\jre
Detected OS: Windows 10
parsing buildfile C:\jacoco_new\build.xml with URI = 
file:/C:/jacoco_new/build.xml
Project base dir set to: C:\jacoco_new
parsing buildfile 
jar:file:/C:/apache-ant-1.10.5/lib/ant.jar!/org/apache/tools/ant/antlib.xml 
with URI = 
jar:file:/C:/apache-ant-1.10.5/lib/ant.jar!/org/apache/tools/ant/antlib.xml 
from a zip file
parsing buildfile 
jar:file:/C:/jacoco_new/jacocoant.jar!/org/jacoco/ant/antlib.xml with URI = 
jar:file:/C:/jacoco_new/jacocoant.jar!/org/jacoco/ant/antlib.xml from a zip file
Build sequence for target(s) `report' is [report]
Complete build sequence is [report, ]
 
report:
[antlib:org.jacoco.ant] Could not load definitions from resource 
org/jacoco/ant/antlib.xml. It could not be found.
[jacoco:report] Loading execution data file C:\jacoco_new\jacoco.exec
 
BUILD FAILED
C:\jacoco_new\build.xml:12: Unable to read execution data file 
C:\jacoco_new\jacoco.exec
        at org.jacoco.ant.ReportTask.loadExecutionData(ReportTask.java:516)
        at org.jacoco.ant.ReportTask.execute(ReportTask.java:490)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:834)
        at org.apache.tools.ant.Main.startAnt(Main.java:223)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: java.io.IOException: Unknown block type 0.
        at 
org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:118)
        at 
org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92)
        at org.jacoco.core.tools.ExecFileLoader.load(ExecFileLoader.java:59)
        at org.jacoco.ant.ReportTask.loadExecutionData(ReportTask.java:514)
        ... 18 more
 
Total time: 1 second
 
 
Second Run:
C:\jacoco_new>ant -v report
Apache Ant(TM) version 1.10.5 compiled on July 10 2018
Trying the default build file: build.xml
Buildfile: C:\jacoco_new\build.xml
Detected Java version: 1.8 in: C:\Program Files\Java\jdk1.8.0_201\jre
Detected OS: Windows 10
parsing buildfile C:\jacoco_new\build.xml with URI = 
file:/C:/jacoco_new/build.xml
Project base dir set to: C:\jacoco_new
parsing buildfile 
jar:file:/C:/apache-ant-1.10.5/lib/ant.jar!/org/apache/tools/ant/antlib.xml 
with URI = 
jar:file:/C:/apache-ant-1.10.5/lib/ant.jar!/org/apache/tools/ant/antlib.xml 
from a zip file
parsing buildfile 
jar:file:/C:/jacoco_new/jacocoant.jar!/org/jacoco/ant/antlib.xml with URI = 
jar:file:/C:/jacoco_new/jacocoant.jar!/org/jacoco/ant/antlib.xml from a zip file
Build sequence for target(s) `report' is [report]
Complete build sequence is [report, ]
 
report:
[antlib:org.jacoco.ant] Could not load definitions from resource 
org/jacoco/ant/antlib.xml. It could not be found.
[jacoco:report] Loading execution data file C:\jacoco_new\jacoco.exec
[jacoco:report] Writing bundle 'DCNM' with 1646 classes
 
BUILD SUCCESSFUL
Total time: 27 seconds
 
C:\jacoco_new>

Thanks,
Senthil

-- 
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/0560bb65-ef9a-41c7-8af1-5ad1276bd409%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to