Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » P2Util and installing new IU's
P2Util and installing new IU's [message #490326] Thu, 08 October 2009 11:38
Andreas  is currently offline Andreas Friend
Messages: 3
Registered: October 2009
Junior Member
Edit: Found someone with the same problem (sorry for posting, I really used the search function!)
http:// www.eclipse.org/forums/index.php?t=msg&goto=490334&S =11a883a7e450b84f2f918e1e67e3d961




Hi devs,

I have an issue with the new p2 update mechanism.
I try to self-update my RCP product by startup and found a good example on ' http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_ RCP_Application#Headless_Updating_on_Startup'. I downloaded the source from CVS and tried to run it on my local machine.
In the P2Util class I have set the 'Metadata Repository' and the 'Artifacts Repository' (both 'file:///D:/test/repository') to the 'ProvisioningContext'.

I have done the following to test the update:
1) export the product in version 1.0.0
2) change version to 1.0.1
3) export product to D:/test (which creates the 'repository'-folder) so that my local repository is D:/test/repository
4) run the 1.0.0 product

I have added some more monitor tasks in the P2Util to see what it is doing (debugging the exported product would be better, but I don't know how to do that).

It seems that the P2Util finds the new version in my repository because the planner.updatesFor(..) method is returning the new IU's.
Afterwards the change-request is generated (removing old IU's, adding new IU's) and the ProvisioningPlan is set.
The status of the ProvisioningPlan is 'OK', so up to this point everything is fine.
But when it finaly comes to perform the Update ( with engine.perform(..) ), it fails with an ERROR message: 'An error occurred while collecting items to be installed'. The Severity flag is 4 (=ERROR).
Some more error code:
session context was:(profile=profile, phase=org.eclipse.equinox.internal.provisional.p2.engine.pha ses.Collect, operand=, action=).
Unable to read repository at file:/D:/test/repository/plugins/org.eclipse.equinox.p2.exam ples.rcp.prestartupdate_1.0.1.200910071508.jar.
Unable to read repository at file:/D:/test/repository/binary/org.eclipse.equinox.p2.examp les.rcp.prestartupdate.product_root.win32.win32.x86_1.0.1.20 0910071508.

When I change the Change-Request to just remove the old IU's, the whole 'update'-process works (the severity flag is OK). So I guess that there is a problem with the installing of the new IU's. The P2Util is also finding that there are new IU's, so the Metadata-Repository is working. There must be an error in finding the binarys in the Artifact-Repository, but I don't know where to start looking.

Here is some code from the two repository XML-files in D:/test/repository:

artifacts.xml:
<artifact classifier='osgi.bundle' id='org.eclipse.equinox.p2.examples.rcp.prestartupdate' version='1.0.1.200910071508'>
<properties size='2'>
<property name='artifact.size' value='0'/>
<property name='download.size' value='112014'/>
</properties>
</artifact>

The 'artifact.size' is zero, is that right?


content.xml:
<unit id='org.eclipse.equinox.p2.examples.rcp.prestartupdate' version='1.0.1.200910071508'>
<update id='org.eclipse.equinox.p2.examples.rcp.prestartupdate' range='[0.0.0,1.0.1.200910071508)' severity='0'/>
<properties size='1'>
<property name='org.eclipse.equinox.p2.name' value='Prestartupdate'/>
</properties>
<provides size='3'>
<provided namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.equinox.p2.examples.rcp.prestartupdate' version='1.0.1.200910071508'/>
<provided namespace='osgi.bundle' name='org.eclipse.equinox.p2.examples.rcp.prestartupdate' version='1.0.1.200910071508'/>
<provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
</provides>
<requires size='19'>
<required namespace='osgi.bundle' name='org.eclipse.ui' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.core.runtime' range='0.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.metadata' range='1.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.metadata.repository' range='1.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.artifact.repository' range='1.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.repository' range='1.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.extensionlocation' range='1.0.100'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.updatesite' range='1.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.director' range='1.0.100'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.engine' range='1.0.100'/>
<required namespace='osgi.bundle' name='org.eclipse.equinox.p2.core' range='1.0.100'/>
<required namespace='osgi.bundle' name='org.eclipse.ecf' range='3.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.ecf.filetransfer' range='3.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.ecf.identity' range='3.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.ecf.provider.filetransfer' range='3.0.0'/>
<required namespace='osgi.bundle' name='org.eclipse.ecf.provider.filetransfer.httpclient' range='3.0.0'/>
<required namespace='osgi.bundle' name='org.apache.commons.codec' range='1.2.0'/>
<required namespace='osgi.bundle' name='org.apache.commons.httpclient' range='3.0.1'/>
<required namespace='osgi.bundle' name='com.example.standalone' range='1.0.0'/>
</requires>
<artifacts size='1'>
<artifact classifier='osgi.bundle' id='org.eclipse.equinox.p2.examples.rcp.prestartupdate' version='1.0.1.200910071508'/>
</artifacts>
<touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
<touchpointData size='1'>
<instructions size='1'>
<instruction key='manifest'>
Bundle-ManifestVersion: 2&#xA;Bundle-Version: 1.0.1.200910071508&#xA;Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,org.eclipse.equinox. p2.metadata;bundle-version=&quot;1.0.0&quot;,org.ecl ipse.equinox.p2.metadata.repository;bundle-version=&quot ;1.0.0&quot;,org.eclipse.equinox.p2.artifact.repository; bundle-version=&quot;1.0.0&quot;,org.eclipse.equinox .p2.repository;bundle-version=&quot;1.0.0&quot;,org. eclipse.equinox.p2.extensionlocation;bundle-version=&quo t;1.0.100&quot;,org.eclipse.equinox.p2.updatesite;bundle -version=&quot;1.0.0&quot;,org.eclipse.equinox.p2.di rector;bundle-version=&quot;1.0.100&quot;,org.eclips e.equinox.p2.engine;bundle-version=&quot;1.0.100&quo t;,org.eclipse.equinox.p2.core;bundle-version=&quot;1.0. 100&quot;,org.eclipse.ecf;bundle-version=&quot;3.0.0 &quot;,org.eclipse.ecf.filetransfer;bundle-version=& quot;3.0.0&quot;,org.eclipse.ecf.identity;bundle-version =&quot;3.0.0&quot;,org.eclipse.ecf.provider.filetran sfer;bundle-version=&quot;3.0.0&quot;,org.eclipse.ec f.provider.filetransfer.httpclient;bundle-version=&quot; 3.0.0&quot;,org.apache.commons.codec;bundle-version=& ;amp ;quot;1.2.0&quot;,org.apache.commons.httpclient;bundle-v ersion=&quot;3.0.1&quot;,com.example.standalone;bund le-version=&quot;1.0.0&quot;&#xA;Bundle-Activato r: org.eclipse.equinox.p2.examples.rcp.prestartupdate.Activator &#xA;Manifest-Version: 1.0&#xA;Bundle-SymbolicName: org.eclipse.equinox.p2.examples.rcp.prestartupdate; singleton:=true&#xA;Bundle-Name: Prestartupdate&#xA;Bundle-RequiredExecutionEnvironment: J2SE-1.5
</instruction>
</instructions>
</touchpointData>
</unit>



I appreciate any help, Andreas

[Updated on: Thu, 08 October 2009 12:00]

Report message to a moderator

Previous Topic:Are you responsible for providing eclipse at your firm?
Next Topic:An error occurred while collecting items to be installed in headless p2 update example
Goto Forum:
  


Current Time: Fri Apr 26 00:21:38 GMT 2024

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

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

Back to the top