Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328926

Summary: osgi.bundles reference file URLs not unescaped
Product: [Eclipse Project] Equinox Reporter: Tobias Oberlies <t-oberlies>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: chris, daniel_megert, tjwatson
Version: unspecified   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
patch none

Description Tobias Oberlies CLA 2010-10-28 09:53:15 EDT
Build Identifier: Helios SR1

"reference" file URIs in the configuration "osgi.bundles" are not properly converted to file names. For example 

osgi.bundles=reference:file:/C:/some%20folder/mybundle_1.0.0.jar@1\:start 

will not install the bundle "C:\some folder\mybundle_1.0.0.jar", but look for a bundle at "C:\some%20folder\mybundle_1.0.0.jar".

The implementation (org.eclipse.core.runtime.adaptor.EclipseStarter.searchForBundle) pareses the string after the "reference:" as java.net.URL. Instead it should attempt to parse it as URI, and only if that fails fall back the the current behaviour.

Reproducible: Always

Steps to Reproduce:
1. Take an RCP
2. Set the osgi.bundles property to reference:file:/C:/some%20folder/mybundle_1.0.0.jar@1\:start in the configuration/config.ini
3. Copy any bundle to C:\some folder\mybundle_1.0.0.jar
4. Launch OSGi with java -jar plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -consolelog
The result is a log entry 

!ENTRY org.eclipse.osgi 4 0 2010-10-28 15:37:09.555
!MESSAGE Bundle reference:file:/C:/some%20folder/mybundle_1.0.0.jar@1\:start not found.

Instead, the bundle should be installed, and then you'll should get messages that the bundle can't be resolved and that the application service can't be acquired.
Comment 1 Thomas Watson CLA 2010-10-28 12:55:43 EDT
I thought this was bug290193, but you are correct.  I looks like we need to do a similar decoding in EclipseStarter for this.
Comment 2 Thomas Watson CLA 2010-12-01 17:15:58 EST
Created attachment 184312 [details]
patch

Patch uses the same approach as bug290193 to fix.
Comment 3 Thomas Watson CLA 2010-12-01 17:16:41 EST
Patch released.
Comment 4 Thomas Watson CLA 2011-02-14 08:28:55 EST
*** Bug 337014 has been marked as a duplicate of this bug. ***