Unhandled exception caught in event loop. [message #98154] |
Tue, 23 September 2003 04:20  |
Eclipse User |
|
|
|
Originally posted by: werner.keplinger.fh-hagenberg.at
I want to create an object of a class, that is not on the classpath.
Executed in a normal main-method the code snippet below works perfectly to
achieve that, however when it is executed in the run-method of an
IObjectActionDelegate I get the following error message: "Unhandled
exception caught in event loop.".
What is the reason for that error message? How can it be avoided ?
Werner
//===code
snippet===================================================== =========
String absoluteClassFileLocation = ...;
String packageName = ...;
String className= ...;
File classFile = new File(absoluteClassFileLocation);
URLClassLoader classloader = URLClassLoader.newInstance(new URL[]
classFile.toURL()});
Class c = classloader.loadClass(packageName + "." + className);
try {
Constructor constructor = c.getConstructor(new Class[] {
String.class });
Object o = constructor.newInstance(new Object[] {"aString" });
} catch (Exception e) {
e.printStackTrace();
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03240 seconds