Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » cannot find packages for p2
cannot find packages for p2 [message #561448] Wed, 30 June 2010 11:45
Luca Ferrari is currently offline Luca FerrariFriend
Messages: 159
Registered: November 2009
Senior Member
Hi all,
I've got an RCP stand-alone application and I'd like to use P2 to provide auto-update mechanism. Having a look at RCP_Application it seems that the Headless Updating on Startup section gives me what I want. However, trying the following code (directly from the web page above):

public class P2Util {
// XXX Check for updates to this application and return a status.
static IStatus checkForUpdates(IProvisioningAgent agent, IProgressMonitor monitor) throws OperationCanceledException {
ProvisioningSession session = new ProvisioningSession(agent);
// the default update operation looks for updates to the currently
// running profile, using the default profile root marker. To change
// which installable units are being updated, use the more detailed
// constructors.
UpdateOperation operation = new UpdateOperation(session);
SubMonitor sub = SubMonitor.convert(monitor,
"Checking for application updates...", 200);
IStatus status = operation.resolveModal(sub.newChild(100));
if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE) {
return status;
if (status.getSeverity() == IStatus.CANCEL)
throw new OperationCanceledException();

if (status.getSeverity() != IStatus.ERROR) {
// More complex status handling might include showing the user what updates
// are available if there are multiples, differentiating patches vs. updates, etc.
// In this example, we simply update as suggested by the operation.
ProvisioningJob job = operation.getProvisioningJob(null);
status = job.runModal(sub.newChild(100));
if (status.getSeverity() == IStatus.CANCEL)
throw new OperationCanceledException();
return status;

I got compilation errors even from IProvisioningAgent: I cannot find the package where the class is, even if I've added the p2.ui, p2.core, p2.ui.sdk and p2.ui.sched bundles to the java build path and runtime dependencies. The only doubt is that I got such bundles directly from the plugins directory of the Eclipse IDE installation.
Am I doing something wrong?
Previous Topic:Plug-in jar remains after feature uninstall
Next Topic:Copying across executables as part of P2 installation
Goto Forum:

Current Time: Fri May 25 05:35:25 GMT 2018

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

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

Back to the top