Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 204341 - [prov] osgi.install.area not set correctly when using a bundle pool
Summary: [prov] osgi.install.area not set correctly when using a bundle pool
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Incubator (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: equinox.incubator-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 212067 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-09-21 19:24 EDT by DJ Houghton CLA
Modified: 2008-02-01 21:59 EST (History)
5 users (show)

See Also:


Attachments
patch (4.33 KB, patch)
2007-09-24 16:56 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2007-09-21 19:24:04 EDT
build 20070921-1856

- download and extract agent zip
- download and extract servers.zip
- run agent
- add local repositories
- create new profile in d:\temp\zz_p1 with the bundle pool location at d:\temp\zz_p1\cfg\bundlepool
- install the agent into the new profile
- try and start up the agent in d:\temp\zz_p1

There seems to be problems with the SimpleConfigurator... it can't install the bundles. What exactly are the file: URLs in the bundles.txt supposed to be relative to?

Tom says that relative reference:file: URLs are relative to the osgi.install.area.
Comment 1 Pascal Rapicault CLA 2007-09-21 22:59:03 EDT
CC'ing Tom because DJ's experiments do not match with Tom's statement.
Comment 2 Thomas Watson CLA 2007-09-22 11:10:08 EDT
I have no idea where to find the p2 builds.  By some pretty miraculous searching I did find the 20070921-1656 builds (but only on an internal build machine, not the public eclipse download site).  Please point me to where the 20070921-1856 build downloads are.  Actually now that I think about it 20070921-1856 is probably a typo, right?  It should be 20070921-1656 I guess.
Comment 3 Thomas Watson CLA 2007-09-22 12:26:23 EDT
org.eclipse.equinox.launcher.Main is setting osgi.install.area to one directory up from where the org.eclipse.equinox.launcher jar is located, but only if the directory which the launcher jar is located is named "plugins".  See Main#getInstallLocation().

In the scenario above osgi.install.area=file:/d:/temp/zz_p1/cfg/bundlepool/ but simple configurator seems to think it should be osgi.install.area=file:/d:/temp/zz_p1/
Comment 4 John Arthorne CLA 2007-09-22 13:17:01 EDT
The M2 build is apparently replicating to eclipse.org now. Instead of giving you a direct link, I'll give a link to a page that will contain the link, in case the final URL changes for any reason. This wiki page will have a link to the agent download when it comes available:

http://wiki.eclipse.org/Equinox_Provisioning_Getting_Started#Step_1_-_Exploring_the_agent
Comment 5 Pascal Rapicault CLA 2007-09-23 21:38:01 EDT
Re comment #3, this is just a plain weird logic... 
I guess that we don't have much else to do than cope with it :-)
Comment 6 Thomas Watson CLA 2007-09-24 01:39:03 EDT
Another option is to set the osgi.install.area in the eclipse.ini to whatever you want.
Comment 7 Thomas Watson CLA 2007-09-24 11:05:09 EDT
Using the following in the eclipse.ini seems to work

-Dosgi.install.area=file:

This assumes that the eclipse.exe always sets the user.dir to the directory where the eclipse.exe is located.  I'm not sure if that is always true.
Comment 8 John Arthorne CLA 2007-09-24 11:22:51 EDT
> This assumes that the eclipse.exe always sets the user.dir to the directory
> where the eclipse.exe is located.

I don't think this is a safe assumption. I recently ran across a bug (jazz 30969) where the user.dir is different on Linux depending on how you launch.
Comment 9 Thomas Watson CLA 2007-09-24 16:56:39 EDT
Created attachment 79090 [details]
patch

This patch uses the -launcher to figure out what the osgi.install.area should be.  The exe currently sets this in the native code.  The thought is this is a more accurate way to figure out where the osgi.install.area is.
Comment 10 Andrew Niefer CLA 2007-10-29 14:24:34 EDT
This patch does not work on the Mac because the executable is in a subdirectory
eclipse/Eclipse.app/Contents/MacOS/eclipse
Comment 11 John Arthorne CLA 2007-12-07 15:05:58 EST
*** Bug 212067 has been marked as a duplicate of this bug. ***
Comment 12 John Arthorne CLA 2007-12-07 15:06:47 EST
Updating title to reflect the real issue.
Comment 13 John Arthorne CLA 2007-12-07 15:07:22 EST
See also bug 186151.
Comment 14 Pascal Rapicault CLA 2008-01-30 21:43:45 EST
I have been playing around with that bug a bit and after a few fixes in p2 to handle some corner cases, it seems that the only satisfactory way to get scenarios like the one described in the initial bug working is to set osgi.install.area to '.' in the config.ini. That way, when started from the eclipse.exe we are sure that the base against which the paths are resolved (which seem to vary depending on which properties are set, which is to me the biggest problem for p2) is set to the install folder and thus have all of our paths computed properly.

However even with that in place I can't get the scenario where the user points at the launcher.jar from outside the install folder working. For example the instlal is c:/eclipse/, the launcher jar is in c:/eclipse/plugins/ and the user types in c:\java -jar eclipse\plugins\launcher.jar

I think that to get all the scenarios straight I will need Tom's and Andrew's help ...
Comment 15 Pascal Rapicault CLA 2008-01-30 21:44:26 EST
Btw I'm not setting osgi.install.area to the actual folder because I want my install to be movable.
Comment 16 Pascal Rapicault CLA 2008-01-31 17:11:34 EST
See also 217351
Comment 17 Pascal Rapicault CLA 2008-02-01 21:59:53 EST
I have released changes in p2 for this. It all comes down to that p2 has to conform to what the runtime does and compute its path relative to the osgi.install.area instead of the installation folder.