Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » P2 bundle info gets mangled if RCP or Eclipse install directory is renamed or moved
P2 bundle info gets mangled if RCP or Eclipse install directory is renamed or moved [message #1803535] Sun, 03 March 2019 12:00 Go to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
I'm trying to update our RCP application so that it uses P2 to install and uninstall packaged features and plugins (in a zip file). So far I've got the basic mechanism working but I have a problem that I need help with:

Moving or renaming the RCP app installation folder is a requirement, as the user may re-installs the app into a different location or simply want to move it to a different location.

However, if the user renames or moves the installation folder of the RCP application then the P2 information in the configuration area no longer matches the path to the installation folder and uninstalling or re-installing features/plugins leads to errors.

Our RCP *.ini file sets the configuration area on Windows as follows:

-Dosgi.configuration.area=@user.home/AppData/Roaming/Archi4/.config


The RCP config.ini is as follows:

eclipse.p2.profile=profile
osgi.framework=file\:plugins/org.eclipse.osgi_3.13.200.v20181130-2106.jar
equinox.use.ds=true
ds.delayed.keepInstances=true
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.3.200.v20181101-1115.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
eclipse.product=com.archimatetool.editor.product
osgi.splashPath=platform\:/base/plugins/com.archimatetool.editor
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.1.300.v20181116-1550.jar
osgi.bundles.defaultStartLevel=4
eclipse.p2.data.area=@config.dir/../p2
eclipse.application=com.archimatetool.editor.app


The following scenario is is where the problem accurs:

1. User installs the RCP app to C:\Archi
2. User installs a new feature using our P2 mechansism.
3. The following folders are then written to or updated in the @user.home/AppData/Roaming/Archi4/ folder:

.config
  | org.eclipse.core.runtime
  | org.eclipse.e4.ui.css.swt.theme
  | org.eclipse.equinox.app
  | org.eclipse.equinox.simpleconfigurator
  | org.eclipse.osgi
  | org.eclipse.update
  | .baseConfigIniTimestamp
  | config.ini
  | eclipse.ini.ignored
features
  | com.example.feature
p2
  | org.eclipse.equinox.p2.core
  | org.eclipse.equinox.p2.engine
plugins
  | com.example.plugin


4. User moves the RCP app to C:\AnotherFolder
5. User now tries to uninstall the feature using P2 but the P2 ProfileChangeOperation Status is "Failed to find a configured bundleInfo for: [R]com.example.pluginname"
6. User now tries to re-install the feature using P2, Status is OK but now the app will not start. The *.log message written in .config folder contains errors such as

org.osgi.framework.BundleException: Could not resolve module: com.example.pluginname [1]
  Unresolved requirement: Require-Bundle: org.eclipse.help.ui


How can I set things up so that this doesn't happen?

[Updated on: Wed, 06 March 2019 22:33]

Report message to a moderator

Tried on Eclipse [message #1803694 is a reply to message #1803535] Wed, 06 March 2019 22:15 Go to previous message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
So I tried using the "dropins" folder approach and ran across the same problem if the RCP installation folder is moved or renamed.

Then I wondered if Eclipse itself has problems with the "dropins" folder and renaming the Eclipse installation folder. Yes, it does if you follow these steps:

1. Install Eclipse into installation folder C:\Eclipse

2. Add the following lines to the "eclipse.ini" file so that the configuration and workspace locations are set to be different:

-Dosgi.instance.area=@user.home/AppData/Roaming/Eclipse
-Dosgi.configuration.area=@user.home/AppData/Roaming/Eclipse/.config


3. Add a plug-in to the "dropins" folder

4. Run Eclipse and check the plug-in is installed.

5. Quit Eclipse

6. Rename the installation folder to "C:\Eclipse2"

7. Run Eclipse. Plug-in is still installed.

8. Quit Eclipse

9. Delete the plug-in from the "dropins" folder

10. Run Eclipse. Plug-in is not installed.

11. Quit Eclipse

12. Put the plug-in back into the "dropins" folder

13. Run Eclipse. Plug-in is still installed.

12. Quit Eclipse

13. Run Eclipse again! Plug-in seems to be still installed but this time various error messages are logged to .log file

14. Quit Eclipse

15. Delete the plug-in from the "dropins" folder

16. Run Eclipse. This time Eclipse will not run! (Error messages are logged)

[Updated on: Wed, 06 March 2019 22:34]

Report message to a moderator

Previous Topic:Bundling JRE in a feature
Next Topic:Problems with P2 garbage collector
Goto Forum:
  


Current Time: Thu Mar 28 15:11:35 GMT 2024

Powered by FUDForum. Page generated in 0.04874 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top