Bug 18191

Summary: Not picking up right plugin version
Product: [Eclipse Project] Platform Reporter: DJ Houghton <dj.houghton>
Component: ResourcesAssignee: Debbie Wilson <debbie_wilson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 2.0   
Target Milestone: 2.0 F2   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
BinaryTestPlugins.zip none

Description DJ Houghton CLA 2002-05-29 11:58:51 EDT
build 2002-05-27 on WinXP.
IBM JRE 1.3.1

- download Eclipse (includes Xerces 4.0.3)
- get Xerces 3.2.1 from a previous drop
- put org.apache.xerces_3.2.1 in eclipse/plugins/
- change plugin.xml for org.eclipse.webdav to require xerces 3.2.1

When I start up this dev image, webdav is using the wrong xerces.
Comment 1 DJ Houghton CLA 2002-05-30 10:11:11 EDT
Note this looks like it works OK on Win2000 but not on WinXP.
Comment 2 Jed Anderson CLA 2002-05-31 14:37:11 EDT
The problem is that we aren't looking at the PluginVersionIdentifier in 
InternalPlatform.activateDefaultPlugins().

Suggested fix:

/**
 * The runtime plug-in is not totally real due to bootstrapping problems.
 * This method builds the required constructs to activate and install
 * the runtime plug-in.
 */
private static void activateDefaultPlugins() throws CoreException {
	// for now, simply do the default activation.  This does not do the 
right thing
	// wrt the plugin class loader.
	PluginDescriptor descriptor = (PluginDescriptor) 
registry.getPluginDescriptor(Platform.PI_RUNTIME);
	DelegatingURLClassLoader loader = PlatformClassLoader.getDefault();
	descriptor.activateDefaultPlugins(loader);
	descriptor.setPluginClassLoader(loader);
	descriptor.getPlugin();

	descriptor = (PluginDescriptor) registry.getPluginDescriptor(PI_XML, 
xmlClassLoader.getPluginDescriptor().getVersionIdentifier());
	descriptor.activateDefaultPlugins(xmlClassLoader);
	descriptor.setPluginClassLoader(xmlClassLoader);
	xmlClassLoader.setPluginDescriptor(descriptor);
	descriptor.getPlugin();
}
Comment 3 Jed Anderson CLA 2002-05-31 14:40:20 EDT
Created attachment 1147 [details]
BinaryTestPlugins.zip
Comment 4 Jed Anderson CLA 2002-05-31 14:45:34 EDT
To reproduce the bug with the BinaryTestPlugins.zip follow these steps:

1. Unzip a 20020530 version of Eclipse.
2. Unzip the BinaryTestPlugins.zip into the plugins directory of your new 
Eclipse install.
3. Start Eclipse.
4. Click "Sample Menu->Sample Action"
5. A popup will appear.

If Eclipse is behaving correctly (like on Win2k) you will see:
<?xml version="1.0" encoding="utf-8"?>
<outer xmlns="myuri:"><inner/></outer>

If you see the following, Eclipse has loaded the wrong version of xerces:
<?xml version="1.0" encoding="utf-8"?>
<outer xmlns="myuri:"><inner xmlns=""/></outer>
Comment 5 DJ Houghton CLA 2002-05-31 17:09:15 EDT
Fixed, versioned and released.
Thanks Jed.