Updated: 3/13/2003; 2:20:44 PM.
IKVM.NET Weblog
The development of a Java VM for .NET
        

Saturday, November 23, 2002
This weblog has moved to http://weblog.ikvm.net/

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.


2:19:31 PM    Comments

© Copyright 2003 Jeroen Frijters.
 
November 2002
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Oct   Dec