2 Replies Latest reply on Jun 21, 2005 1:46 PM by chiba

    javassist.CannotCompileException: by java.lang.LinkageError:

    solmaz1

      hi,

      I am trying to alter a method body

      CtClass clazz = ClassPool.getDefault().get("test.test2.InvokeeBuilder");
      CtMethod method = clazz.getDeclaredMethod("delegation");
      method.setBody("test.test2.Invokee.display($1);");
      clazz.toClass();

      fist of all ok.

      secodary, I 'm using the same class to alter method body (in the same JVM app server JBoss)

      CtClass clazz = ClassPool.getDefault().get("test.test2.InvokeeBuilder");
      CtMethod method = clazz.getDeclaredMethod("delegation");
      method.setBody("test.test2.Invokee.display_new($2);");

      clazz.toClass() throws javassist.CannotCompileException: by java.lang.LinkageError: duplicate class definition ...

      how can I handle this case.

      thanks.