Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » P2 in RCP Application
P2 in RCP Application [message #108249] Wed, 16 April 2008 11:05 Go to next message
Kai Tödter is currently offline Kai Tödter
Messages: 9
Registered: July 2009
Junior Member
Has anyone experience how to integrate p2 in a RCP application for self hosting (and self updating)?

Thanx

Kai
Re: P2 in RCP Application [message #108290 is a reply to message #108249] Wed, 16 April 2008 16:27 Go to previous messageGo to next message
Simon Clarkson is currently offline Simon Clarkson
Messages: 2
Registered: July 2009
Junior Member
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
remain unanswered.

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.

Simon
Re: P2 in RCP Application [message #108323 is a reply to message #108249] Wed, 16 April 2008 21:07 Go to previous messageGo to next message
Eclipse User
Originally posted by: spam.luebken.com

Hi

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
http://wiki.eclipse.org/Equinox_p2_Getting_Started#Running_t he_p2_UI_from_a_self-hosted_workbench

- Create an RCP-App like included the Mail-Example
- Implement an Update-Action and implement the following run()-method:
ICommandService commandService = (ICommandService)
PlatformUI.getWorkbench().getService(ICommandService.class);
IHandlerService handlerService = (IHandlerService)
PlatformUI.getWorkbench().getService(IHandlerService.class);
Command cmd =
commandService.getCommand("org.eclipse.equinox.p2.ui.sdk.update ");
ExecutionEvent executionEvent =
handlerService.createExecutionEvent(cmd, null);
cmd.executeWithChecks(executionEvent);

- Edit the run-configuration:
Select your rcp-plugin, org.eclipse.equinox.p2.exemplarysetup and
org.eclipse.equinox.simpleconfigurator.manipulator and select "Add
required Plug-ins"
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
Features

- 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
standalone)

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?

Phewwww.
Matthias
Re: P2 in RCP Application [message #108452 is a reply to message #108249] Tue, 22 April 2008 10:16 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5331
Registered: July 2009
Senior Member
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
different things:
- 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.

Tom

Kai Tödter schrieb:
> Has anyone experience how to integrate p2 in a RCP application for self hosting (and self updating)?
>
> Thanx
>
> Kai


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: P2 in RCP Application [message #108467 is a reply to message #108452] Tue, 22 April 2008 14:29 Go to previous messageGo to next message
Eclipse User
Originally posted by: joerg.von.frantzius.artnology.com

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tom &nbsp; schrieb:
<blockquote cite="mid:fukdu3$ss4$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
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
different things:
<br>
- self-hosting is when you start your RCP inside Eclipse use PDE
<br>
- self-updating is when the rcp updates itself
<br>
<br>
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.
<br>
</blockquote>
The <a
href="http://wiki.eclipse.org/Equinox_p2_Getting_Started#Dropins">P2
Wiki</a> says about Dropins:<br>
<blockquote>"Various policies can be applied to watched directories to
configure
when they are checked for new content, and whether to eagerly install
discovered content."
</blockquote>
Maybe by default the dropins folder in an exported product isn't
configured to "eager install"? How ever this can be configured and
where...<br>
<blockquote cite="mid:fukdu3$ss4$1@build.eclipse.org" type="cite"><br>
Tom
<br>
<br>
Kai T&ouml;dter schrieb:
<br>
<blockquote type="cite">Has anyone experience how to integrate p2 in
a RCP application for self hosting (and self updating)?
<br>
<br>
Thanx
<br>
<br>
Kai
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</body>
</html>
Re: P2 in RCP Application [message #108481 is a reply to message #108249] Tue, 22 April 2008 15:36 Go to previous messageGo to next message
Eclipse User
Originally posted by: spam.luebken.com

Right now I've given up. But as I heard there is a good chance that M7
will make it easier. Let's hope.
Re: P2 in RCP Application [message #108707 is a reply to message #108467] Wed, 23 April 2008 22:32 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5331
Registered: July 2009
Senior Member
Jörg von Frantzius schrieb:
> Tom schrieb:
>> 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
>> different things:
>> - 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.
> The P2 Wiki <http://wiki.eclipse.org/Equinox_p2_Getting_Started#Dropins>
> says about Dropins:
>
> "Various policies can be applied to watched directories to configure
> when they are checked for new content, and whether to eagerly
> install discovered content."
>
> Maybe by default the dropins folder in an exported product isn't
> configured to "eager install"? How ever this can be configured and where...
>>

The hard step is to get your RCP-Mail-App act as a P2 enabled
application (in fact you'll like to create the meta using an application
coming with Eclipse). With help on IRC I have a command line that should
give me what I want. I'll give it a try tomorrow when I'm back at my
office and report my findings.

Tom


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: P2 in RCP Application [message #108953 is a reply to message #108707] Mon, 28 April 2008 23:27 Go to previous messageGo to next message
Eclipse User
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)?

Nigel Westbury
Re: P2 in RCP Application [message #111257 is a reply to message #108249] Sun, 01 June 2008 17:55 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5331
Registered: July 2009
Senior Member
So guys we are at RC3. Has anybody here ever managaged to get his/her
RCP P2-Enabled? If yes would you mind writing up a short HOWTO for the
Mail-Application?

Tom

Kai Tödter schrieb:
> Has anyone experience how to integrate p2 in a RCP application for self hosting (and self updating)?
>
> Thanx
>
> Kai


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: P2 in RCP Application [message #111450 is a reply to message #111257] Tue, 03 June 2008 15:00 Go to previous messageGo to next message
Kai Tödter is currently offline Kai Tödter
Messages: 9
Registered: July 2009
Junior Member
I am getting closer, read my blog entry (http://toedter.com/blog/?p=24) for the current state.

Kai
Re: P2 in RCP Application [message #111498 is a reply to message #111450] Tue, 03 June 2008 20:10 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5331
Registered: July 2009
Senior Member
Hi Kai,

Great. I'll give it a try too :-). What's the new checkbox I can check
when exporting in PDE, it also creates P2-things, right?

I'm a little bit nervous that all those good coders I know hit a wall
when creating a P2-enabled RCP. It's one thing that P2 works good inside
eclipse but for normal RCP the story seems to be a bit different.

Tom

Kai Tödter schrieb:
> I am getting closer, read my blog entry (http://toedter.com/blog/?p=24) for the current state.
>
> Kai


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: P2 in RCP Application [message #112124 is a reply to message #108249] Tue, 17 June 2008 09:26 Go to previous messageGo to next message
Kai Tödter is currently offline Kai Tödter
Messages: 9
Registered: July 2009
Junior Member
Hi All,

I finally made it, see my blog http://toedter.com/blog/?p=27

Thanks to all who helped!

Kai
Re: P2 in RCP Application [message #112229 is a reply to message #112124] Thu, 19 June 2008 19:45 Go to previous message
Andrew Niefer is currently offline Andrew Niefer
Messages: 990
Registered: July 2009
Senior Member
I have also put together an RCP example product with p2:
http://aniefer.blogspot.com/2008/06/example-headless-build-f or-rcp-product.html

-Andrew
Kai Tödter wrote:
> Hi All,
>
> I finally made it, see my blog http://toedter.com/blog/?p=27
>
> Thanks to all who helped!
>
> Kai
Previous Topic:Classic Update Capability and P2
Next Topic:java.lang.NoClassDefFoundError: javax/xml/namespace/QName
Goto Forum:
  


Current Time: Mon Sep 22 20:36:27 GMT 2014

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

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