title: ClassNotFound Error when using mockito to mock a class
body: <p>I am trying to mock a class using Mockito and also using PowerMock.
  This is the test</p>
  
  <pre><code>@RunWith(PowerMockRunner.class)
  @PrepareForTest(value = Util.class)
  public final class FSNS_MLFTUnitTests
  {
      @Test
      public final void testChecksum()
      {
          final Util mockedServiceB = mock(Util.class);
          try
          {
              whenNew(Util.class).withNoArguments().thenReturn(mockedServiceB);
          }
         catch (final Exception e)
         {
              System.out.println("Exception thrown: " + e);
         }
  }
  </code></pre>
  
  <p>I get the following error when trying to run the test.</p>
  
  <pre><code>java.lang.ExceptionInInitializerError
  at sun.reflect.GeneratedSerializationConstructorAccessor6.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
  at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:40)
  at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)
  at org.mockito.internal.creation.jmock.ClassImposterizer.createProxy(ClassImposterizer.java:120)
  at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:60)
  at org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl(MockCreator.java:79)
  at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock(MockCreator.java:53)
  at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:80)
  at com.cerner.edc.ccm.host.drivers.fsns.mlft.FSNS_MLFTUnitTests.testChecksum(FSNS_MLFTUnitTests.java:23)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:592)
  at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:322)
  at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86)
  at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94)
  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:309)
  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:297)
  at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
  at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:222)
  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:161)
  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:135)
  at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
  at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:133)
  at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:112)
  at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:44)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  Caused by: com.system.exception.ExceptionAdapter
      at com.util.lang.ClassAssistant.lookupClass(ClassAssistant.java:50)
      at com.util.lang.ClassAssistant.lookupClass(ClassAssistant.java:66)
      at com.logging.edc.EdcAssistant.getResourceBundle(EdcAssistant.java:113)
      at com.logging.edc.EdcLogger.&lt;init&gt;(EdcLogger.java:26)
      at com..logging.edc.EdcLoggerManager.getLogger(EdcLoggerManager.java:50)
      at com.framework.Util.&lt;clinit&gt;(Util.java:65)
      ... 36 more
  </code></pre>
  
  <p>This error is being thrown on the mock(Util.class).</p>
  
  <p>These are the following pom dependencies that I am using:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.powermock.modules&lt;/groupId&gt;
    &lt;artifactId&gt;powermock-module-junit4&lt;/artifactId&gt;
    &lt;version&gt;1.3.1&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.powermock.api&lt;/groupId&gt;
    &lt;artifactId&gt;powermock-api-mockito&lt;/artifactId&gt;
    &lt;version&gt;1.3.1&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;4.6&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.mockito&lt;/groupId&gt;
    &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
    &lt;version&gt;1.8.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Any help is appreicated.</p>
  
  <p>Thanks!!</p>