John Goering
John Goering

Reputation: 39040

Getting ClassFormatError with EMMA?

I'm trying to generate code coverage reports with EMMA using tests of which some use JMockit as a mocking framework. For the most part, it works, but a few of my tests crash with a ClassFormatError, like so:

java.lang.ClassFormatError
    at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
    at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:79)
    at mockit.internal.RedefinitionEngine.redefineMethods(RedefinitionEngine.java:138)
    at mockit.internal.RedefinitionEngine.redefineMethods(RedefinitionEngine.java:73)
    at mockit.Mockit.setUpMocks(Mockit.java:177)
    at test.my.UnitTest.setUpBeforeClass(UnitTest.java:21)

Any idea what is going on, and whether I can fix the problem? Or are EMMA and JMockit mutually exclusive?

Upvotes: 2

Views: 1144

Answers (2)

Reputation:

From where and how to remove this "reentry=true"

Upvotes: 0

John Goering
John Goering

Reputation: 39040

Seems to be a bug in JMockit: After the class was already instrumented by EMMA, JMockit seems to have issues creating "reentry=true" mock methods.

Removing the "reentry=true" "worked around" the issue.

Upvotes: 1

Related Questions