Evgeny,

 

Thanks for the response.

 

JMockit 1.47 isn’t released yet, according to the JMockit website.  That is why 
I upgraded to 1.46 rather than 1.47.  And 1.47 isn’t available on Maven Central 
yet.

 

I looked at the classpath of the project in Eclipse, which is generated from 
the Maven pom.xml, and it has JMockit 1.46.  In the pom.xml, for the 
maven-surefire-plugin, I have explicitly specified the ASM 7.1 as a dependency. 
  I even explicitly added ASM 7.1 to be a test dependency in the pom.xml 
(outside of maven-surefire-plugin), and that didn’t fix it either.

 

Since this builds correctly on the command line, and does not in Eclipse 
2019-03, and the dependencies are correct in Eclipse for the project, this has 
to be an Eclipse problem.  There is something internal to Eclipse that is 
pulling in an older version of ASM that doesn’t have the NestHost/NestMembers 
problem fix, as you pointed out in the stack trace.

 

Thanks,

JD

 

From: [email protected] <[email protected]> On Behalf Of Evgeny 
Mandrikov
Sent: Friday, June 21, 2019 10:28 AM
To: JaCoCo and EclEmma Users <[email protected]>
Subject: Re: [java code coverage] Eclipse 2019-03 EclEmma plugin is causing 
UnsupportedOperationException

 

In addition to what was said by Marc:

 

Eclipse 2019-03 ships with

EclEmma 3.1.2

which uses JaCoCo 0.8.3

which in his turn includes and uses official ASM 7.0

 

that has nothing to do with ASM embedded/forked/rewritten in JMockit.

 

Support of Java 11 JEP 181 (NestHost/NestMembers) was implemented in official 
ASM 7.0 and to our knowledge no changes in this support was done since then.

 

IMO this could easily be an issue in JMockit, and BTW you use not the latest 
one, which is 1.47.



On Friday, June 21, 2019 at 5:20:57 PM UTC+2, Marc R. Hoffmann wrote:

Does this error also occur when you run your tests in Eclipse in normal “run” 
mode (no coverage)?

 

In this case JaCoCo or EclEmma is not involved in your runtime classpath at 
all. And even when you run your application with with JaCoCo the JaCoCo agent 
includes its own repackaged version of ASM which will not interfere with other 
ASM versions on the class path.

 

Regards,

-marc

 

 

On 21. Jun 2019, at 17:12, jahunsmythe <[email protected] 
<mailto:[email protected]> > wrote:

 

This error does not occur with command line builds of my project.

 

But in Eclipse, when running the JUnit tests, this error occurs.

I am assuming that this is occurring is the version of JaCoCo that EclEmma is 
using has a dependency on an older version of ASM that has not fixed the 
problem with NestHost and NestMembers.

Just an FYI:  I am using EclEmma/JaCoCo combined with JMockit.  This shouldn't 
be the cause, as this is a known problem with ASM.

See the JMockit issue for more information about this:

 

https://github.com/jmockit/jmockit1/pull/555

 

My environment:

 

Windows 10

Eclipse 2019-03

Java 11.0.1

JUnit 5

JMockit 1.46

ASM 7.1

 

The Exception from a JUnit test in Eclipse that is failing:

 

java.lang.UnsupportedOperationException: class redefinition failed: attempted 
to change the class NestHost or NestMembers attribute

           at 
java.instrument/sun.instrument.InstrumentationImpl.redefineClasses0(Native 
Method)

           at 
java.instrument/sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:193)

           at mockit.internal.startup.Startup.redefineMethods(Startup.java:159)

           at 
mockit.internal.state.MockFixture.redefineClasses(MockFixture.java:159)

           at 
mockit.internal.expectations.mocking.BaseTypeRedefinition.applyClassRedefinition(BaseTypeRedefinition.java:221)

           at 
mockit.internal.expectations.mocking.BaseTypeRedefinition.redefineClass(BaseTypeRedefinition.java:215)

           at 
mockit.internal.expectations.mocking.BaseTypeRedefinition.redefineClassAndItsSuperClasses(BaseTypeRedefinition.java:188)

           at 
mockit.internal.expectations.mocking.BaseTypeRedefinition.redefineClassAndItsSuperClasses(BaseTypeRedefinition.java:204)

           at 
mockit.internal.expectations.mocking.BaseTypeRedefinition.redefineMethodsAndConstructorsInTargetType(BaseTypeRedefinition.java:175)

           at 
mockit.internal.expectations.mocking.BaseTypeRedefinition.redefineTargetClassAndCreateInstanceFactory(BaseTypeRedefinition.java:251)

           at 
mockit.internal.expectations.mocking.BaseTypeRedefinition.redefineType(BaseTypeRedefinition.java:67)

           at 
mockit.internal.expectations.mocking.TypeRedefinition.redefineType(TypeRedefinition.java:28)

           at 
mockit.internal.expectations.mocking.FieldTypeRedefinitions.redefineFieldType(FieldTypeRedefinitions.java:78)

           at 
mockit.internal.expectations.mocking.FieldTypeRedefinitions.redefineFieldType(FieldTypeRedefinitions.java:65)

           at 
mockit.internal.expectations.mocking.FieldTypeRedefinitions.redefineFieldTypes(FieldTypeRedefinitions.java:53)

           at 
mockit.internal.expectations.mocking.FieldTypeRedefinitions.<init>(FieldTypeRedefinitions.java:33)

           at 
mockit.integration.internal.TestRunnerDecorator.handleMockFieldsForWholeTestClass(TestRunnerDecorator.java:141)

           at 
mockit.integration.junit5.JMockitExtension.postProcessTestInstance(JMockitExtension.java:52)

           at 
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeTestInstancePostProcessors$3(ClassTestDescriptor.java:215)

           at 
org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.executeAndMaskThrowable(JupiterTestDescriptor.java:141)

           at 
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeTestInstancePostProcessors$4(ClassTestDescriptor.java:215)

           at 
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)

           at 
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)

           at 
java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)

           at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)

           at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)

           at 
java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)

           at 
java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)

           at 
java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)

           at 
java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)

           at 
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeTestInstancePostProcessors(ClassTestDescriptor.java:214)

           at 
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateAndPostProcessTestInstance(ClassTestDescriptor.java:196)

           at 
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$0(ClassTestDescriptor.java:185)

           at 
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$1(ClassTestDescriptor.java:189)

           at java.base/java.util.Optional.orElseGet(Optional.java:369)

           at 
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$2(ClassTestDescriptor.java:188)

           at 
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:81)

           at 
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:58)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.prepare(HierarchicalTestExecutor.java:89)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:74)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:121)

           at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)

           at 
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)

           at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)

           at 
java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)

           at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)

           at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)

           at 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)

           at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)

           at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

           at 
java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:121)

           at 
org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:121)

           at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)

           at 
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)

           at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)

           at 
java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)

           at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)

           at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)

           at 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)

           at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)

           at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

           at 
java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:121)

           at 
org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:55)

           at 
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)

           at 
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)

           at 
org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)

           at 
org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)

           at 
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)

           at 
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137)

           at 
org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)

           at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)

           at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)

           at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)

           at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)

           at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

 

 

-- 
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] 
<mailto:[email protected]> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/24302a95-cbc1-4b6e-bbac-884b2d9ba510%40googlegroups.com
 
<https://groups.google.com/d/msgid/jacoco/24302a95-cbc1-4b6e-bbac-884b2d9ba510%40googlegroups.com?utm_medium=email&utm_source=footer>
 .

 

-- 
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] 
<mailto:[email protected]> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/8c3098dd-c07e-4bf0-a108-2a7c5f398d5c%40googlegroups.com
 
<https://groups.google.com/d/msgid/jacoco/8c3098dd-c07e-4bf0-a108-2a7c5f398d5c%40googlegroups.com?utm_medium=email&utm_source=footer>
 .

-- 
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/006001d52a15%24b9b14520%242d13cf60%24%40smithoptimalsolutions.com.

Reply via email to