Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Uninstalling feature using p2 director after feature had been updated via update site
Uninstalling feature using p2 director after feature had been updated via update site [message #768547] Tue, 20 December 2011 10:42
Marcin   is currently offline Marcin
Messages: 8
Registered: October 2011
Junior Member
Hello,

I have a problem with the following scenario:

1. I install a feature using p2 director from command line(works fine)
2. I check for updates in eclipse (GUI), and feature is updated from the corporate update site since there is a newer version (also works fine)
3. I uninstall the feature using p2 director from command line - this fails. (It works correctly when no updating through update site is involved.) The exception I get is as follows:

java.lang.IllegalStateException: Profile PlatformProfile is not current. Expected timestamp 1324376389757 but was 1324376389757.
	at org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry.lockProfile(SimpleProfileRegistry.java:752)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:65)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
	at org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.executePlan(PlanExecutionHelper.java:41)
	at org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.executePlan(PlanExecutionHelper.java:23)
	at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.updateRoamingProperties(DirectorApplication.java:1022)
	at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.performProvisioningActions(DirectorApplication.java:549)


I tried to debug this, but the problem is that when I call p2 director from the "debug configurations" uninstalling works. This is probably because it has some more parameters given to the p2 director (like -dev -data and especially -configuration which has a path to a newly created configuration folder). The thing I manage to figure out is that when debugging executeMethod of PlanExcecutionHelper

public static IStatus executePlan(IProvisioningPlan result, IEngine engine, IPhaseSet phaseSet, ProvisioningContext context, IProgressMonitor progress) {
  if (!result.getStatus().isOK())
    return result.getStatus();

  if (result.getInstallerPlan() != null) {
    IStatus installerPlanStatus = ((IEngine) result.getInstallerPlan().getProfile().getProvisioningAgent().getService(IEngine.SERVICE_NAME)).perform(result.getInstallerPlan(), phaseSet, progress);
    if (!installerPlanStatus.isOK())
      return installerPlanStatus;
    Configurator configChanger = (Configurator) ServiceHelper.getService(DirectorActivator.context, Configurator.class.getName());
    try {
      configChanger.applyConfiguration();
    } catch (IOException e) {
      return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_error_applying_configuration, e);
    }
  }
  return engine.perform(result, phaseSet, progress);
}


the result.getInstallerPlan() returns null and the if block is not executed. In normal situation (I used print outs) this block is executed and the last line engine.perform(..) fails somewhere inside.

Any ideas? I'm struggling with this second day I feel that I'm running out of ideas...

I'm using Windows XP and Eclipse 3.6.1.

Best Regards,
Marcin

[Updated on: Tue, 20 December 2011 13:04]

Report message to a moderator

Previous Topic:Build p2 update site metadata without any Eclipse installation
Next Topic:Possible to download files other than jars through update site?
Goto Forum:
  


Current Time: Tue Sep 16 23:41:09 GMT 2014

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

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