From: SourceForge.net <no...@so...> - 2004-12-07 20:35:42
|
Bugs item #1080869, was opened at 2004-12-07 14:35 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=438935&aid=1080869&group_id=44253 Category: Interactions Group: None Status: Open Resolution: None Priority: 5 Submitted By: Dan Smith (dlsmith) Assigned to: Nobody/Anonymous (nobody) Summary: Class.forName() doesn't work in interactions pane Initial Comment: After defining the following class in the Definitions pane and compiling, I have the interaction below. class MyClass { static Class lookup() throws ClassNotFoundException { return Class.forName("MyClass"); } } > MyClass.class class MyClass > MyClass.lookup() class MyClass > Class.forName("MyClass") ClassNotFoundException: MyClass at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) > It appears that something is wrong with the ClassLoader used by Class.forName(). My Interactions classpath is as follows: C:\Documents and Settings\Dan\Desktop\drjava-beta-20041124.exe C:\Program Files\Java\jdk1.5.0\lib\tools.jar C:\cygwin\home\Dan\Misc [location of MyClass.java] I've tested this on DrJava versions 20041124-2208 and 20040908-2125 under Windows XP Professional and Java 1.5.0. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=438935&aid=1080869&group_id=44253 |