title: Jmockit NullPointerException with Junit
body: <p>I'm trying to run a test that written by another programmer with JUnit in eclipse-indigo,  and he is sure it works but when I try Jmockit there is a failure and I can't find a solution, yet.</p>
  
  <p>I try to change jmockit.jar in classpath but not working. Do you have any idea about this problem? </p>
  
  <p>Edit: When I use "ant test" in terminal there is no problem but if I click run as > JUnit test in my IDE I got this error.</p>
  
  <pre><code>Exception in thread "(Attach Listener)" java.lang.reflect.InvocationTargetException
  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:597)
  at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
  at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:348)
  Caused by: java.lang.NullPointerException
  at mockit.internal.state.TestRun.getInstance(TestRun.java:40)
  at mockit.internal.state.TestRun.mockFixture(TestRun.java:111)
  at mockit.internal.ClassFile.createClassFileReader(ClassFile.java:33)
  at mockit.internal.annotations.AnnotatedMockMethodCollector.collectMockMethods(AnnotatedMockMethodCollector.java:39)
  at mockit.internal.RedefinitionEngine.&lt;init&gt;(RedefinitionEngine.java:86)
  at mockit.internal.RedefinitionEngine.&lt;init&gt;(RedefinitionEngine.java:110)
  at mockit.internal.startup.Startup.setUpInternalStartupMock(Startup.java:130)
  at mockit.internal.startup.Startup.loadInternalStartupMocksForJUnitIntegration(Startup.java:112)
  at mockit.internal.startup.Startup.initialize(Startup.java:79)
  at mockit.internal.startup.Startup.agentmain(Startup.java:69)
  ... 6 more
  Agent failed to start!
  [WARN ][load   ] agent library 'instrument' failed to init with result: 102
  java.lang.RuntimeException: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
  at mockit.internal.startup.JDK6AgentLoader.loadAgentAndDetachFromThisVM(JDK6AgentLoader.java:130)
  at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:80)
  at mockit.internal.startup.AgentInitialization.initializeAccordingToJDKVersion(AgentInitialization.java:41)
  at mockit.internal.startup.Startup.initializeIfNeeded(Startup.java:244)
  at org.junit.runner.Runner.&lt;clinit&gt;(Runner.java:25)
  at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:13)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
  at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:30)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
  at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.&lt;init&gt;(JUnit4TestReference.java:32)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.&lt;init&gt;(JUnit4TestClassReference.java:25)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:41)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:455)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:684)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:391)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  Caused by: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
  at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:122)
  at mockit.internal.startup.JDK6AgentLoader.loadAgentAndDetachFromThisVM(JDK6AgentLoader.java:123)
  at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:81)
  ... 16 more
  java.lang.NoClassDefFoundError: org/junit/internal/runners/ErrorReportingRunner
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
  at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.&lt;init&gt;(JUnit4TestReference.java:32)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.&lt;init&gt;(JUnit4TestClassReference.java:25)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:41)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
  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)
  </code></pre>