# Saturday, 23 November 2002
« Swamp | Main | More Miranda »
Eclipse

For the time being I switched back to jikes 1.15. When trying to start Eclipse (M2), it failed with a ClassNotFoundException: org.xml.sax.InputSource.

It turns out that in org.eclipse.core.internal.runtime.InternalPlatform the following method causes a problem:

public synchronized static
PluginRegistryModel parsePlugins(URL[] pluginPath,
                               
 Factory factory,
                                 boolean
debug) {
// If the platform is not running then simply parse the
//
 registry.
//
 We don't need to play any funny class loader games as
//
 we assume the XML classes are on the class path
// This happens when we are running this code as part of
// a
 utility (as opposed to starting or inside the
// platform).

if (!(InternalBootLoader.isRunning() ||
     InternalBootLoader.isStarting()))
  return RegistryLoader.parseRegistry(pluginPath,
                                      factory,
                                      debug);

// If we are running the platform, we want to conserve
// class loaders.
// Temporarily install the xml class loader as a
// prerequisite
of the platform class loader
// This allows us to find the xml classes. Be sure to
// reset the prerequisites after loading.

PlatformClassLoader.getDefault().setImports(
  
new DelegatingURLClassLoader[]
    { xmlClassLoader });

try {
  return RegistryLoader.parseRegistry(pluginPath,
                                      factory,
                                      debug);
} finally {
 
PlatformClassLoader.getDefault().setImports(null);
}
}

The bold line basically adds the xerces plugin to the classpath, this is needed because RegistryLoader depends on it. However, in IK.VM.NET the RegistryLoader class gets compiled when the above parsePlugins method is JITted by the .NET runtime, and at that moment the xerces code is not yet available.

This is an interesting problem, but I'm not sure if this construction is actually guaranteed to work on all VMs by the spec.

Saturday, 23 November 2002 14:19:31 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]