Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » PDE ignores p2.inf(Building a rcp-product, PDE doesn't generate profile-file using p2.inf)
PDE ignores p2.inf [message #537150] Tue, 01 June 2010 13:14 Go to next message
Roberto  is currently offline Roberto Friend
Messages: 6
Registered: June 2010
Junior Member
Hi,

since three days I'm trying to make our rcp client (3.5) p2 ready...
First I generated features for all plug-ins we created. Then I created an update site and changed the product to "feature-based".
The exported product is runnable. So far, so good.

Now I'm trying to add a headless update to the rcp client.

So I found this tutorial:
http://www.ralfebert.de/blog/eclipsercp/p2_updates_tutorial/

I downloaded and embedded the plug-in linked in the paragraph "Updating on application". After starting the client no progress monitor popped up. I debugged the "checkForUpdates" method and found out that
profileRegistry.getProfile(IProfileRegistry.SELF);

returns null.

So a profile-file is missing. (.\p2\org.eclipse.equinox.p2.engine\profileRegistry is empty)

After an internet research I found out, that I have to include a p2.inf file in the product's directory. But PDE ignores this file! No profile is generated when I export the product.
If I add syntax errors in this file, PDE doesn't bring an error. So it ignores this file completely!

What am I doing wrong?

Thanks in advance!

Roberto
Re: PDE ignores p2.inf [message #537235 is a reply to message #537150] Tue, 01 June 2010 15:57 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Roberto wrote:

> After an internet research I found out, that I have to include a p2.inf
> file in the product's directory. But PDE ignores this file! No profile
> is generated when I export the product.
> If I add syntax errors in this file, PDE doesn't bring an error. So it
> ignores this file completely!


In e4 we have a product with a p2.inf (see [1] for
legacy-eclipse.product and p2.inf). I know we had to add a
p2.publish.product call to our customTargets.xml [2] and then use the
director to install our product IU.


[1]
http://dev.eclipse.org/viewcvs/index.cgi/e4/org.eclipse.e4.u i/examples/org.eclipse.e4.ui.examples.legacy.workbench/

[2]
http://dev.eclipse.org/viewcvs/index.cgi/e4/releng/org.eclip se.e4.builder/builder/general/customTargets.xml?view=co& content-type=text/plain

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: PDE ignores p2.inf [message #537274 is a reply to message #537150] Tue, 01 June 2010 18:26 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Make sure you check the box "Generate Metadata Repository" in the product
export wizard.

You don't need a p2.inf file, what you need is for the product to be
properly installed and configured for p2. This is done automatically for
you when you check the metadata box during export.

If you don't check that option then you get a plain old fashion product that
doesn't have the required configuration to properly use p2.

-Andrew
Roberto wrote:

> Hi,
>
> since three days I'm trying to make our rcp client (3.5) p2 ready...
> First I generated features for all plug-ins we created. Then I created an
> update site and changed the product to "feature-based". The exported
> product is runnable. So far, so good.
>
> Now I'm trying to add a headless update to the rcp client.
>
> So I found this tutorial:
> http://www.ralfebert.de/blog/eclipsercp/p2_updates_tutorial/
>
> I downloaded and embedded the plug-in linked in the paragraph "Updating on
> application". After starting the client no progress monitor popped up. I
> debugged the "checkForUpdates" method and found out that
> profileRegistry.getProfile(IProfileRegistry.SELF); returns null.
>
> So a profile-file is missing.
> (.\p2\org.eclipse.equinox.p2.engine\profileRegistry is empty)
>
> After an internet research I found out, that I have to include a p2.inf
> file in the product's directory. But PDE ignores this file! No profile is
> generated when I export the product. If I add syntax errors in this file,
> PDE doesn't bring an error. So it ignores this file completely!
>
> What am I doing wrong?
>
> Thanks in advance!
>
> Roberto
Re: PDE ignores p2.inf [message #537450 is a reply to message #537274] Wed, 02 June 2010 13:51 Go to previous messageGo to next message
Roberto  is currently offline Roberto Friend
Messages: 6
Registered: June 2010
Junior Member
With the "Generate Metadata Repository" the profile is generated, thank you!

But now I've got another problem and a question:

The problem is:
The ProvisioningPlan runs into an error.

if (plan.getStatus().getSeverity() != IStatus.ERROR) 

is false...

I can't find the reason Sad

The declaration part of the plan object:
ProfileChangeRequest changeRequest = new ProfileChangeRequest(profile);

changeRequest.removeInstallableUnits((IInstallableUnit[]) iusWithUpdates.toArray(new IInstallableUnit[iusWithUpdates.size()]));

changeRequest.addInstallableUnits((IInstallableUnit[]) replacementIUs.toArray(new IInstallableUnit[replacementIUs.size()]));

ProvisioningPlan plan = planner.getProvisioningPlan(changeRequest, pc, null);


The question is:

I have got a feature based product. But the updater checks the version of every feature and every plugin. I thought that only the feature version numbers are checked in a feature based product?

Regards
Roberto

Andrew Niefer wrote on Tue, 01 June 2010 14:26
Make sure you check the box "Generate Metadata Repository" in the product
export wizard.

You don't need a p2.inf file, what you need is for the product to be
properly installed and configured for p2. This is done automatically for
you when you check the metadata box during export.

If you don't check that option then you get a plain old fashion product that
doesn't have the required configuration to properly use p2.

-Andrew
Roberto wrote:


[Updated on: Wed, 02 June 2010 14:07]

Report message to a moderator

Re: PDE ignores p2.inf [message #542813 is a reply to message #537150] Sat, 26 June 2010 10:32 Go to previous message
Roberto  is currently offline Roberto Friend
Messages: 6
Registered: June 2010
Junior Member
The problem was that if you export the product with the jre it also adds the jre to the repository and tries to update the jre (which is not possibly while using the jre Very Happy). So you need to export without a jre and add the jre folder manually.

Because of a bug in eclipse you need to install Eclipse again to build a product without jre with PDE (it ignores the checkbox when exporting jre is selected once).

Very buggy the whole p2 manager Evil or Very Mad
Previous Topic:Stuck on Equinox Aspects Quickstart Guide
Next Topic:DS and Spring beans
Goto Forum:
  


Current Time: Thu Mar 28 15:22:08 GMT 2024

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

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

Back to the top