java.lang.NoClassDefFoundError

Could not initialize class org.mockito.internal.util.MockUtil

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web5307

  • Could not initialize class org.mockito.internal.util.MockUtil
  • via GitHub by dolendupes
    , 10 months ago
    Could not initialize class org.mockito.internal.util.MockUtil
  • via GitHub by dolendupes
    , 10 months ago
    Could not initialize class org.mockito.internal.util.MockUtil
  • Stack trace

    • java.lang.NoClassDefFoundError: Could not initialize class org.mockito.internal.util.MockUtil at org.mockito.internal.configuration.injection.scanner.MockScanner.isMockOrSpy(MockScanner.java:83) at org.mockito.internal.configuration.injection.scanner.MockScanner.preparedMock(MockScanner.java:71) at org.mockito.internal.configuration.injection.scanner.MockScanner.scan(MockScanner.java:59) at org.mockito.internal.configuration.injection.scanner.MockScanner.addPreparedMocks(MockScanner.java:45) at org.mockito.internal.configuration.InjectingAnnotationEngine.injectMocks(InjectingAnnotationEngine.java:84) at org.mockito.internal.configuration.InjectingAnnotationEngine.processInjectMocks(InjectingAnnotationEngine.java:50) at org.mockito.internal.configuration.InjectingAnnotationEngine.process(InjectingAnnotationEngine.java:44) at org.mockito.MockitoAnnotations.initMocks(MockitoAnnotations.java:67) at org.mockito.internal.runners.SilentJUnitRunner$1.withBefores(SilentJUnitRunner.java:29) at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:276) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.mockito.internal.runners.SilentJUnitRunner.run(SilentJUnitRunner.java:39) at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:35) at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:104) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.