Jacoco coverage issue after changing to Java 8

3,685 views
Skip to first unread message

afri...@gmail.com

unread,
Jun 24, 2015, 9:56:38 AM6/24/15
to jac...@googlegroups.com
Hi,

After switching to Java 8 , I'm getting the bellow error.

[echo] ValidatorBLTest.java
[jacoco:coverage] Enhancing junit with coverage
[junit] Exception in thread "main" java.lang.reflect.InvocationTargetException
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] at java.lang.reflect.Method.invoke(Method.java:497)
[junit] at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
[junit] at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
[junit] Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
[junit] at org.jacoco.agent.rt.internal_9dd1198.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
[junit] at org.jacoco.agent.rt.internal_9dd1198.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:99)
[junit] at org.jacoco.agent.rt.internal_9dd1198.PreMain.createRuntime(PreMain.java:55)
[junit] at org.jacoco.agent.rt.internal_9dd1198.PreMain.premain(PreMain.java:47)
[junit] ... 6 more
[junit] Caused by: java.lang.NoSuchFieldException: $jacocoAccess
[junit] at java.lang.Class.getField(Class.java:1703)
[junit] at org.jacoco.agent.rt.internal_9dd1198.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:136)
[junit] ... 9 more
[junit] FATAL ERROR in native method: processing of -javaagent failed
[junit] Running x.y.z.bl.ValidatorBLTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Test x.y.z.bl.ValidatorBLTest FAILED (crashed)


Please advice ,
Thanks in advance

Evgeny Mandrikov

unread,
Jun 25, 2015, 9:24:15 AM6/25/15
to jac...@googlegroups.com, afri...@gmail.com, afri...@gmail.com
Hi,

Seems that you are using JaCoCo version 0.6.3 , while support for Java 8 was added in later versions - see http://www.eclemma.org/jacoco/trunk/doc/changes.html Please upgrade to most recent one, which is 0.7.5 - http://www.jacoco.org/jacoco/index.html

afri...@gmail.com

unread,
Jun 25, 2015, 9:47:58 AM6/25/15
to jac...@googlegroups.com, afri...@gmail.com
Hi Evgeny,
Actually I used version 0.7.5.
After switching to 0.7.6 snapshot issue solved.

Henrik Horneber

unread,
Jun 25, 2015, 10:01:02 AM6/25/15
to jac...@googlegroups.com
Just as a different view on this:

We had the same issue, but using jacoco 0.7.5 resolved it.

Also, org.jacoco.agent.rt.internal_9dd1198 very much looks like 0.6.x.

regards,
Henrik



--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/07b91812-cd9e-4a5f-8415-ce2b9b46179b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"I find many of the machines of violence very attractive. Tanks, airplanes, warships, especially aircraft carriers."
- 14th Dalai Lama

Evgeny Mandrikov

unread,
Jun 25, 2015, 10:14:32 AM6/25/15
to jac...@googlegroups.com, horn...@gmail.com
amiraf, I doubt that you used "0.7.5" - I double checked that "org.jacoco.agent.rt.internal_9dd1198" is from 0.6.3, so agree with Henrik. If issue is solved, then fine, but keep in mind that preferable to use released version than snapshot.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+unsubscribe@googlegroups.com.

Amir Afrimian

unread,
Jun 26, 2015, 1:05:32 AM6/26/15
to jac...@googlegroups.com
Ok thanks 

I'll double check this and will update .

Thanks for your help ...
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.



--
"I find many of the machines of violence very attractive. Tanks, airplanes, warships, especially aircraft carriers."
- 14th Dalai Lama

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/vVt7HfiDzes/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/9d20e26f-520b-40c1-bf41-07e9cf6791fe%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
אמיר אפרימיאן.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages