question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ExceptionInInitializerError thrown in Eclipse OpenJ9 JVM

See original GitHub issue

When trying to run tests using Eclipse OpenJ9, I get this error:

java.lang.ExceptionInInitializerError
        at com.bar.foo.<clinit>(FooTest.java:24)
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.ClassLoader$CompoundEnumeration@626d5804
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.mockito.exceptions.base.MockitoInitializationException:

Could not initialize inline Byte Buddy mock maker.

It appears as if your JDK does not supply a working agent attachment mechanism.
Java               : 11
JVM vendor name    : Eclipse OpenJ9
JVM vendor version : openj9-0.23.0
JVM name           : Eclipse OpenJ9 VM
JVM version        : 11.0.9+11
JVM info           : JRE 11 Windows 10 amd64-64-Bit Compressed References 20201022_795 (JIT enabled, AOT enabled)
OpenJ9   - 0394ef754
OMR      - 582366ae5
JCL      - 3b09cfd7e9 based on jdk-11.0.9+11
OS name            : Windows 10
OS version         : 10.0

Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process

I tried running the same test using Oracle’s OpenJDK 11 implementation and it ran successfully.

I’m not familiar with Byte Buddy at all, so I don’t know how to fix it myself. But I really think there’s something wrong with the implementation, because my tests are able to run on a specific JVM but not in other.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
raphwcommented, Sep 25, 2021

Interesting finding. It extracts the process id and then uses sn official API to connect to this process. To me this indicates that the there’s an issue in J9.

0reactions
mateusbandeiraacommented, Oct 1, 2021

Closing this issue since it is an OpenJ9 bug rather than a ByteBuddy problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

All Java 8 classes opened in 2021-13 fail with Java 9 ... - Eclipse
I've been using 2020-12 since its release with many Java 8 projects. I've been running it with Java 15, but the projects are...
Read more >
NoClassDefFoundError omits original ExceptionInInitializerError
When an ExceptionInInitializerError is thrown, this error ought to be saved in class metadata by the JVM, and used as a NoClassDefFoundError.cause if...
Read more >
AdoptOpenJDK J9 JVM - Clojure Q&A
I am having trouble with Clojure on the J9 JVM. I'm interested in J9 in hopes Clojure ... load(Unknown Source) at clojure.main__init.
Read more >
OpenJ9 - Wikipedia
Eclipse OpenJ9 is a high performance, scalable, Java virtual machine (JVM) implementation that is fully compliant with the Java Virtual Machine ...
Read more >
Mockito cannot mock this class - java - Stack Overflow
I had the same issue after I update to new java version with OpenJ9 JVM, now I am using HotSpot JVM ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found