[jboss-jira] [JBoss JIRA] Created: (JASSIST-143) Getting an exception NotFoundException

sagar shinde (JIRA) jira-events at lists.jboss.org
Wed Jun 29 14:32:23 EDT 2011


Getting an exception NotFoundException
--------------------------------------

                 Key: JASSIST-143
                 URL: https://issues.jboss.org/browse/JASSIST-143
             Project: Javassist
          Issue Type: Feature Request
    Affects Versions: 3.14.0.GA
         Environment: Windows Vista, Jdk 1.6 
            Reporter: sagar shinde
            Assignee: Shigeru Chiba


I am facing problem in using JavaAssist in Eclipse 3.6.1. I have added the javassist.jar file in the project created in eclipse through buildpath option. My program details r as follows: 

 // 1st program:
package temp;
//import javassist.*;

public class Hello {

	  public void say() {
	        System.out.println("Hello");
	    }
	}
_________________________________________________________

2nd program: 

package temp;

import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;


public class Test {
    public static void main(String[] args) throws Exception {
        ClassPool cp = ClassPool.getDefault();
        CtClass cc = cp.get("Hello");
      
       CtMethod m = cc.getDeclaredMethod("say");
       m.insertBefore("{ System.out.println(\"Hello.say():\"); }");
       Class c = cc.toClass();
      Hello h = (Hello)c.newInstance();
      h.say();
        
        System.out.println("test prog:");
    }

}


Test class while executing shows the error for cp.get() method saying NotFoundException. Whts the error? 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list