|Re: P2 in RCP Application [message #108290 is a reply to message #108249]
||Wed, 16 April 2008 12:27
| Simon Clarkson
Registered: July 2009
Yes, we have plenty of experience trying to do this. No one here has |
succeeded. A colleague was at EclipseCon and spoke with someone from the
Pulse team about this. He was told that the Pulse team was only able to
get p2 to work because they personally knew the p2 developers and had
inside knowledge, and it was still difficult.
While it was straight forward to write the code to update a profile, there
is no way of getting access to the running profile.
I know that if anyone here figured out a way to do this, we would trumpet
the solution to everyone. As no one has claimed to be able to do this,
let alone tell anyone how it can be done, I can only assume that no one
has yet succeeded. The use case you describe is to me the holy grail of
provisioning. There have been prior posts on this problem and they all
The IDE, as of M6, can do this, so the obvious thing is to look at that
code. However, without the ability to step through the code, we have not
yet succeeded in finding all the tricks.
We have spent a lot of time looking at the profile code and I am happy to
share our findings, though as we got nowhere our findings are not worth
much. You start by finding things like the IProfileRegistry.SELF
constant, but then you realize that is nothing more than a convenient way
of getting the profile name set in eclipse.p2.profile. The profile does
not exist, as I would expect, in the registry, and if you create it, it is
not pre-configured with the installed bundles, so that is no good. We can
provision a profile by reading bundles.info, but then the installed
bundles are not started in the running app.
|Re: P2 in RCP Application [message #108323 is a reply to message #108249]
||Wed, 16 April 2008 17:07
Originally posted by: spam.luebken.com|
I've tried to get an P2-RCP-Example running the last couple of days. No
success so far. I haven't digged to much into the concepts yet because I
would like to learn P2 from an existing example.
Here are my steps I've did so far:
- Grab the P2 sources
( http://wiki.eclipse.org/Equinox_p2_Getting_Started_for_Devel opers)
- Patch ProvSDKUIActivator according
- Create an RCP-App like included the Mail-Example
- Implement an Update-Action and implement the following run()-method:
ICommandService commandService = (ICommandService)
IHandlerService handlerService = (IHandlerService)
Command cmd =
ExecutionEvent executionEvent =
- Edit the run-configuration:
Select your rcp-plugin, org.eclipse.equinox.p2.exemplarysetup and
org.eclipse.equinox.simpleconfigurator.manipulator and select "Add
Start your app and see if the Update-Action brings up the Update-Dialog.
- Create a simple plugin that gets updated like org.example.test
- Create a simple feature that includes this plugin
- Export this feature File | Export | Plugin Development | Deployable
- Start your rcp-app. Switch to "Available Software". Select "Add Site".
Select "Local" and browse to the directory you have exported your
features to. Select the folder "p2repo"
- The feature should be in the list.
If I try to install the feature I'll get the following error:
"An error occurred while collecting items to be installed The required
Touchpoint: org.eclipse.equinox.p2.osgi 1.0.0 touchpoint was not found"
(BTW I get the same error if I export the whole rcp-app and start it
Now I have several questions:
- How do I circumvent th error. Do I have to configure a touchpoint? How?
- I had to use features. I thought P2 was able to update plugins?
|Re: P2 in RCP Application [message #108467 is a reply to message #108452]
||Tue, 22 April 2008 10:29
Originally posted by: joerg.von.frantzius.artnology.com|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
<blockquote cite="mid:firstname.lastname@example.org" type="cite">Hi,
I'm also struggling to get this working and it really frustrates me. If
I understood it correctly self-hosting and self-updateing are 2
- self-hosting is when you start your RCP inside Eclipse use PDE
- self-updating is when the rcp updates itself
And if I'm not wrong self-updating is supported by P2 with any code
hacks. I would not mind if I could at least drop my plugins into a
directly and they are recognized but that's not working either.I have
all p2.* plugins from M6 inside my exported RCP-Application but when
dropping an additional plugin and restart it is not recognized.
Wiki</a> says about Dropins:<br>
<blockquote>"Various policies can be applied to watched directories to
when they are checked for new content, and whether to eagerly install
Maybe by default the dropins folder in an exported product isn't
configured to "eager install"? How ever this can be configured and
<blockquote cite="mid:email@example.com" type="cite"><br>
Kai Tödter schrieb:
<blockquote type="cite">Has anyone experience how to integrate p2 in
a RCP application for self hosting (and self updating)?
|Re: P2 in RCP Application [message #108953 is a reply to message #108707]
||Mon, 28 April 2008 19:27
Originally posted by: nigel.miegel.org|
I doubt the problem is to do with the dropins directory. The tricky part
is, as Tom says, running the application p2 enabled.
It is hard to know where to start, as this process is still quite tricky
(even with M7). Tom is correct in stating the distinction between
self-hosting and self-provisioning (a.k.a. self-updating). You can debug
this in self-hosting mode but you will not see the bundles become active.
Depending on how you are set up, you might see the bundles become active
in the IDE, but this is not what you want.
The first question is how are you starting the bundles. Rather than start
all the bundles by listing them in the osgi.bundles (typically set in
config.ini), put instead just
org.eclipse.equinox.simpleconfigurator@1:start. This bundle will then,
when started, look in bundles.info (in its configuration area) for the
current set of bundles. By doing this, you do not have to have all the
bundles in the plugin directory. Unfortunately I find I have to build the
bundles.info by hand as that is the only way to get it right. If it is
not picking up bundles.info, try specifying the fullpath, e.g.
-Dorg.eclipse.equinox.simpleconfigurator.configUrl=file:/c:/ my-install-directory/configuration/org.eclipse.equinox.simpl econfigurator/bundles.info.
Inside bundles.info, you can either specify a full path for the file:
part, or just file:plugins.... But if you plug-ins come from different
places, which is likely unless you copy everything to the same place, then
you need the full path. You will need to update the timestamps each time
if loading jars or directories with versioned names.
Another thing to be careful about. You will need to include certain
bundles even though there are no dependencies on them. You will need at
least the eclipse touchpoint plug-in. You will need the
o.e.ecf.provider.filetransfer plug-in. You will need the
o.e.equinox.p2.updatesite plug-in if you are to access update sites. How
far are you getting? Are you downloading the artifacts (i.e. do you see
the progress monitor as the jars are downloaded)? Are the new bundles
being resolved? (If not, are the running bundles in the profile)?
Powered by FUDForum
. Page generated in 0.02731 seconds