title: java.lang.IllegalStateException: Failed to transform class
body: <pre><code>&lt;testcase time="0.593" classname="org.apache.maven.surefire.junit4.JUnit4Provider" name="facade.FacadeBeanTest"&gt;
      &lt;error message="Failed to transform class with name BusinessServiceImpl. Reason: NameKeyList" type="java.lang.IllegalStateException"&gt;java.lang.IllegalStateException: Failed to transform class with name BusinessServiceImpl. Reason: NameKeyList
      at javassist.ClassPool.get(ClassPool.java:450)
      at javassist.bytecode.Descriptor.toCtClass(Descriptor.java:592)
      at javassist.bytecode.Descriptor.getReturnType(Descriptor.java:489)
      at javassist.CtBehavior.getReturnType0(CtBehavior.java:306)
      at javassist.CtMethod.getReturnType(CtMethod.java:217)
      at org.powermock.core.transformers.impl.MainMockTransformer.modifyMethod(MainMockTransformer.java:172)
      at org.powermock.core.transformers.impl.MainMockTransformer.allowMockingOfStaticAndFinalAndNativeMethods(MainMockTransformer.java:142)
      at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:65)
      at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:215)
      at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:147)
      at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:247)
      at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
      at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
      at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
      at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
      at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
      at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:653)
      at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460)
      at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
      at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
      at java.lang.Class.initAnnotationsIfNecessary(Class.java:3070)
      at java.lang.Class.getAnnotations(Class.java:3050)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.classAnnotations(PowerMockJUnit44RunnerDelegateImpl.java:163)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.getDescription(PowerMockJUnit44RunnerDelegateImpl.java:155)
      at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.getDescription(JUnit4TestSuiteChunkerImpl.java:171)
      at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.getDescription(AbstractCommonPowerMockRunner.java:47)
      at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:51)
      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
      &lt;/error&gt;
  &lt;/testcase&gt;
  
  @Test
  public void createRegistrationTest() {
      try {
          RegistrationResponse response = facadeBeanTest.createAegistration(RegistrationFacadeMock.getCreateRegistrationRequest());
          Assert.assertEquals(true, response.isRegistrationSuccessful());
      } catch (Exception e) {
          Assert.fail("Exception occured : " + e);
      }
  
  }
  </code></pre>
  
  <p>Test case return success full and return expected result. While I build a project , getting exception in the testsuite xml and build failed.
  Any idea , did I miss any version of mockit or powermock?</p>
  
  <p>Pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.mockito&lt;/groupId&gt;
      &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
      &lt;version&gt;1.10.8&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
     &lt;groupId&gt;org.powermock&lt;/groupId&gt;
     &lt;artifactId&gt;powermock-module-junit4&lt;/artifactId&gt;
     &lt;version&gt;1.5.1&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
     &lt;groupId&gt;org.powermock&lt;/groupId&gt;
     &lt;artifactId&gt;powermock-api-mockito&lt;/artifactId&gt;
     &lt;version&gt;1.5.1&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Under BsuinessServiceImpl.java have a lot of methods,only createRegistration() called in test method and returned success </p>
  
  <pre><code>public createRegistration(){
  ammoRegistrationPeristenceImpl.create(ammoRegistrationPO);
  }
  
  protected NameKeyList generateNameKeys(Name name) throws Exception {
  try {
      return searchUtil.getRemote().getNameKeys(name);
  } catch (RemoteException e) {
  
  }
  }
  </code></pre>