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.

Stackoverflow error when upgrading to v3.5.2

See original GitHub issue

I tried to upgrade from Mockito v3.4.6 to v3.5.2 and I’m getting a stackoverflow error (same error with v3.5.0) when running some tests (not all of them, just a few ; even in the same class : some tests pass and others don’t).

Stacktrace :

java.lang.StackOverflowError
	at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:163)
	at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.lambda$new$3(InlineByteBuddyMockMaker.java:260)
	at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.handleConstruction(MockMethodAdvice.java:176)
	at org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher.handleConstruction(MockMethodDispatcher.java:53)
	at java.base/java.lang.Throwable.<init>(Throwable.java)
	at java.base/java.lang.Exception.<init>(Exception.java:66)
	at java.base/java.lang.RuntimeException.<init>(RuntimeException.java:62)
	at java.base/java.lang.ClassCastException.<init>(ClassCastException.java:58)
	at java.base/java.lang.Throwable.<init>(Throwable.java)
	at java.base/java.lang.Exception.<init>(Exception.java:66)
	at java.base/java.lang.RuntimeException.<init>(RuntimeException.java:62)
	at java.base/java.lang.ClassCastException.<init>(ClassCastException.java:58)
	at java.base/java.lang.Throwable.<init>(Throwable.java)
	at java.base/java.lang.Exception.<init>(Exception.java:66)
        ...

I didn’t succeed in reproduce the error in a small project, but I’ll spend more time to try and post the sources here when/if I have a reproducible case.

Environment :

  • Mockito v3.5.2
  • JUnit v5.6.2
  • Java :

openjdk version “11.0.8” 2020-07-14 OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1) OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)

  • Maven : v3.6.0 (tests are run by the maven-surefire plugin)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jdussouillezcommented, Aug 26, 2020

@raphw Thank you for the fix and the time spent on this. It works great !

0reactions
jdussouillezcommented, Aug 26, 2020

You can drop the config and just use the inline artifact which defines the nock maker for you.

I used mockito-inline v3.5.6, all tests passed but 3. The 3 that fails are new ones (not the ones who failed before) and none of them use Mockito (but all of them are on enums, apparently MyEnum.values() returns an array with null values inside). But they’re executed correctly when running them manually, class by class (like I did before)

Do you know how can I generate the inline JAR from the sources ? I can’t provide you the logs I added in the source with mockito-inline because the JAR is not generated by ./gradlew -x check clean build.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Routes match error upgrading from 2.3 to 5.2.3 - Stack Overflow
match method is deprecated in rails 5.0 or above, the reason is to encourage people to use only GET and POST .
Read more >
Upgrade Jasper version from 5.2.0 to 6.2.2 causing ...
We have recently upgraded Jasper version from 5.2.0 to 6.2.2, After that Report generation failing with below stack overflow error.
Read more >
StackOverflowError while installing in silent mode - Community
Hello We're trying to install our product in silent mode. Unfortunately, we got following error. REGISTRY ALREADY STORED!
Read more >
5.2.2 OpenJDK 8 UnmodifiableCollection StackOverFlowError
We'd been running a new stable 3-node cluster using ES 5.1.1 for about 3 weeks but upgraded to 5.2.2 after coming across a...
Read more >
Error: java.lang.StackOverflowError - ShinyProxy
Error : java.lang.StackOverflowError · Install Java for rJava · Install OpenJDK-8 · Install dependency libraries · install needed R packages · make ...
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