|Re: P2 in RCP Application [message #108290 is a reply to message #108249]
||Wed, 16 April 2008 16: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 #108953 is a reply to message #108707]
||Mon, 28 April 2008 23: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.02423 seconds