Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » An error occurred while collecting items to be installed in headless p2 update example
An error occurred while collecting items to be installed in headless p2 update example [message #480125] Fri, 14 August 2009 00:02 Go to next message
Michael Yara is currently offline Michael YaraFriend
Messages: 27
Registered: July 2009
Junior Member
Hello,

I am trying to get the headless p2 update example to run on a local
repository. I have pulled the code from the MailRCP example found here.

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.equinox /p2/examples/org.eclipse.equinox.p2.examples.rcp.prestartupd ate/?root=RT_Project

I have modified P2Util to change the URI repository locations that are
searched. I have replaced:

final URI[] reposToSearch =
manager.getKnownRepositories(IRepositoryManager.REPOSITORIES _ALL);

with

URI[] tempReposToSearch = null;
try {
tempReposToSearch = new URI[] {(new
URI("file:///C:/Documents%20and%20Settings/Mike/Desktop/test/"))};
} catch (Exception e) {
System.err.println("Exception");
}

final URI[] reposToSearch = tempReposToSearch;


when the update runs with the above modification on my repo the line

IStatus status = engine.perform(profile,
new DefaultPhaseSet(), plan.getOperands(),
pc, sub.newChild(100, SubMonitor.SUPPRESS_ALL_LABELS));


returns an Error status with a message of "An error occurred while
collecting items to be installed", an error code of "4" and no exception.

I have even tried

final URI[] reposToSearch = new URI[] {(new File("C:\\Documents and
Settings\\Mike\\Desktop\\test\\").toURI())};

with no luck. Can someone please help.

Thanks,
Mike
Re: An error occurred while collecting items to be installed in headless p2 update example [message #480293 is a reply to message #480125] Fri, 14 August 2009 18:56 Go to previous messageGo to next message
Michael Yara is currently offline Michael YaraFriend
Messages: 27
Registered: July 2009
Junior Member
Ok I think i figured this one out. It looks like if you pass a progress
monitor to the plan executor it fails in the described fashion but if
you set the monitor to null it works just fine.

Dosen't Work:
IStatus status = engine.perform(profile, new DefaultPhaseSet(),
plan.getOperands(), pc, sub.newChild(100, SubMonitor.SUPPRESS_ALL_LABELS));

Works:
IStatus status = engine.perform(profile, new DefaultPhaseSet(),
plan.getOperands(), pc, null);


No to figure out why it is causing the problem.

Michael Yara wrote:
> Hello,
>
> I am trying to get the headless p2 update example to run on a local
> repository. I have pulled the code from the MailRCP example found here.
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.equinox /p2/examples/org.eclipse.equinox.p2.examples.rcp.prestartupd ate/?root=RT_Project
>
>
> I have modified P2Util to change the URI repository locations that are
> searched. I have replaced:
>
> final URI[] reposToSearch =
> manager.getKnownRepositories(IRepositoryManager.REPOSITORIES _ALL);
>
> with
>
> URI[] tempReposToSearch = null;
> try {
> tempReposToSearch = new URI[] {(new
> URI("file:///C:/Documents%20and%20Settings/Mike/Desktop/test/"))};
> } catch (Exception e) {
> System.err.println("Exception");
> }
>
> final URI[] reposToSearch = tempReposToSearch;
>
>
> when the update runs with the above modification on my repo the line
>
> IStatus status = engine.perform(profile,
> new DefaultPhaseSet(),
> plan.getOperands(),
> pc, sub.newChild(100,
> SubMonitor.SUPPRESS_ALL_LABELS));
>
>
> returns an Error status with a message of "An error occurred while
> collecting items to be installed", an error code of "4" and no exception.
>
> I have even tried
>
> final URI[] reposToSearch = new URI[] {(new File("C:\\Documents and
> Settings\\Mike\\Desktop\\test\\").toURI())};
>
> with no luck. Can someone please help.
>
> Thanks,
> Mike
Re: An error occurred while collecting items to be installed in headless p2 update example [message #490334 is a reply to message #480293] Thu, 08 October 2009 11:57 Go to previous message
Andreas  is currently offline Andreas Friend
Messages: 3
Registered: October 2009
Junior Member
Hi Mike,
I had the same problem. Thank you VERY much for sharing your find! Smile
I never thought about setting the monitor to null, but that really did it. It must be a bug in P2Util?
Andreas
Previous Topic:P2Util and installing new IU's
Next Topic:Equinox p2 for an arbitrary OSGi application?
Goto Forum:
  


Current Time: Sat Apr 27 03:14:16 GMT 2024

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

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

Back to the top