ClassLoader.loadClass() failures
I'm working on a program that reflects on arbitrary jar and class files. I'm seeing some reproducible ClassNotFoundExceptions that I can't understand. I tried reflection rt.jar and found three such examples. Here's a test case:
class loadfail
{
public static void main(String[] args)
{
ClassLoader cl = ClassLoader.getSystemClassLoader();
String[] classNames = { "com.sun.jndi.toolkit.corba",
"com.sun.jndi.url.corbaname",
"com.sun.jndi.se.org.omg" };
for (int i = 0; i < classNames.length; i++)
try {
cl.loadClass(classNames);
}
catch (Exception e) {
System.out.println("Error: " + e.toString());
}
}
}
When I run this I get:
Error: java.lang.ClassNotFoundException: com.sun.jndi.toolkit.corba
Error: java.lang.ClassNotFoundException: com.sun.jndi.url.corbaname
Error: java.lang.ClassNotFoundException: com.sun.jndi.se.org.omg
these are the only three class loading failures I see among all of rt.jar.
I'm running XP.
C:\>java -version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
If there's something peculiar about these three classes, then can anyone suggest how I might go about debugging the more general problem? In some cases a portion of classes within a jar load, and a portion fail. In other cases no classes out of a jar fail to load. Other times all classes load as expected. I don't see any commonality among the failed cases.
Thanks in advance.

