Class loaded but not loaded for the demo program Trace
I'm extending the program Trace of the jpda example, trying to add dynamic class load funtion in it, without using the command line to set the classpath.
Here below is the construction method,
I used personalized classloader to load a class and pass it to the constructor of Trace
public Trace(Class classe){
vm =null;
System.out.println(classe.getName());
Class mainArgType[] ={(new String[0]).getClass()};
try{
java.lang.reflect.Method main = classe.getMethod("main", mainArgType);
System.out.println("main: " + main.toString());
String progArg[] ={""};
Object mainArg[] ={progArg};
main.invoke(null, mainArg);
}
catch (NoSuchMethodException ex){
System.out.println("nessun metodo");
}
in tre previous part, the loaded class is loaded and executed, but when I continue to the following code
vm = launchTarget(classe.getName());
PrintWriter writer =new PrintWriter(System.out);
generateTrace(writer);
}
It gave me a java.lang.NoClassDefFoundError, how come?
Although the methods of launchTarget and others were left unchanged.
Is there any answer to this?
Or can I get another approach to this tracing problem?

