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.

JDK9 NoClassDefFoundError

See original GitHub issue

Building with jdk9-ea build 130 and Mockito 2.0.96-beta fails with,

java.lang.NoClassDefFoundError: Could not initialize class com.github.benmanes.caffeine.cache.CacheWriter$MockitoMock$1566132372
    at jdk.internal.reflect.GeneratedSerializationConstructorAccessor13.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(java.base@9-ea/Constructor.java:453)
    at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:45)
    at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
    at org.mockito.internal.creation.instance.ObjenesisInstantiator.newInstance(ObjenesisInstantiator.java:14)
    at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:32)
    at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
    at org.mockito.internal.MockitoCore.mock(MockitoCore.java:63)
    at org.mockito.Mockito.mock(Mockito.java:1560)
    at org.mockito.Mockito.mock(Mockito.java:1473)
    at com.github.benmanes.caffeine.cache.testing.CacheSpec$Writer$2.get(CacheSpec.java:515)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
raphwcommented, Aug 10, 2016

I think this will be decided soon, as soon as I know more, I will try to get Mockito Java 9 ready.

1reaction
ben-manescommented, Aug 10, 2016

Yep, that’s fair and my viewpoint as well. A user decided to pitch in and see if he could migrate my project and this was a blocker.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NoClassDefFoundError (Java SE 9 & JDK 9 )
Constructs a NoClassDefFoundError with the specified detail message. Method Summary. Methods inherited from class java.lang.Object · clone, equals, ...
Read more >
Handling NoClassDefFoundError for JAXBException in Java 9
Learn how to solve the JAXBException when migrating to Java 9.
Read more >
How to resolve java.lang.NoClassDefFoundError: javax/xml ...
When I run the same code with Java 9, at runtime I get errors indicating that JAXB classes can not be found. The...
Read more >
NoClassDefFoundError JAXBException under JDK9 #8254
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at org.hibernate.boot.spi.XmlMappingBinderAccess.
Read more >
javax/xml/bind/JAXBException for JDK9 - Help/Discuss
Hi, Building my project with Gradle. For Java8 build passes, for Java9 it fails with Caused by: java.lang.NoClassDefFoundError: ...
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