On Friday, 5 April 2019 06:47:10 UTC-7, Marc R. Hoffmann  wrote:
> Hi Senthil,
> 
> the error message means that the execution data file 
> "C:\jacoco_new\jacoco.exec” is corrupted. It contains a unexpected 0x00 byte 
> where a valid record header is expected instead.
> 
> How do you create this file?
> 
> Regards,
> -marc
> 
> 
> 
> 
> 
> > On 4. Apr 2019, at 21:56, psk....@gmail.com wrote:
> > 
> > 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 jacoco+unsubscr...@googlegroups.com.
> > 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.

Hi Marc,
I am hooking the jacocoagent with my application server. After started the 
application server, will run manual testing / automated test cases. Once 
testing is done will stop my application server. When i stop application 
server, automatically class files created under jacoco and jacoco.exec get 
create.

If i ran 10 times, 1 time getting succeeded and 9 times fails with the above 
reason.
What is the reason for corruption?
How i can run successfully without any issues?
Is there any workaround / fixes?

# Used for Jacoco 
JAVA_OPTS="$JAVA_OPTS 
-javaagent:/usr/local/taco/dcm/jacoco/jacocoagent.jar=output=file,address=*,destfile=/usr/local/taco/dcm/jacoco/jacoco.exec,append=false,includes=com.taco.dcbu.vinci.rest.services.*:com.taco.dcbu.web.client.rest.*,excludes=com.taco.taglib.*:com.taco.dcbu.sm.server.scheduler.jobs.*:com/taco/dcbu/jaxws*,classdumpdir=/usr/local/taco/dcm/jacoco/"

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 jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/3f0f1d3d-d1fb-4c9e-8642-a1e39bee6f77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to