Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » P2 Update fails with non default osgi.configuration.area
P2 Update fails with non default osgi.configuration.area [message #1058478] Tue, 14 May 2013 10:25
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member

I am trying to use an equinox based application in a shared environment as described here as Szenario #2 or #3.

The installation is done with the p2 director using a p2 site created with buckminster.

My hope was that multiple users could use the shared install, but have their own configuration area so that they can individualy update the application. My problem is that the p2 update does not work anymore in this case: It does not find the changed plugins and returns "nothing to update" although this is not true.

In my search for an answer i found out that the p2 update stops working as soon as I use a non default configuration area (osgi.configuration.area), even with a local install.

I think that this might by a problem with the query on a profile. I did some more tests with this code to get the root feature (of which I know that it is the only one with an id that starts with "de.emsw.gosa.feature"):

private IInstallableUnit findRootFeature(IProfile profile) {
	IInstallableUnit[] userVisibleRoot = profile.query(new UserVisibleRootQuery(), null).toArray(IInstallableUnit.class);
	if (userVisibleRoot.length == 0) {
		logger.warn("Root IU not found!"); //$NON-NLS-1$
	} else {
		logIu(userVisibleRoot[0], "ROOT"); //$NON-NLS-1$
		for (IRequirement requirement : userVisibleRoot[0].getRequirements()) {
			IMatchExpression<IInstallableUnit> matchExpression = requirement.getMatches();
			String id = matchExpression.getParameters()[0].toString();
			if (id.startsWith("de.emsw.gosa.feature")) { //$NON-NLS-1$
				IInstallableUnit[] queryResult = profile.query(QueryUtil.createIUQuery(id), null).toArray(IInstallableUnit.class);
				return getLatestVersion(queryResult);
	return null;

private IInstallableUnit getLatestVersion(IInstallableUnit[] queryResult) {
	if (queryResult.length == 0)
		return null;
	IInstallableUnit latest = queryResult[0];
	if (queryResult.length > 1) {
		for (int i = 1; i < queryResult.length; i++) {
			if (queryResult[i].getVersion().compareTo(latest.getVersion()) > 0) {
				latest = queryResult[i];
	return latest;

With a standard local install this code works as expected and returns the root feature which was installed. With a costum configuration area the root feature is not found because
profile.query(QueryUtil.createIUQuery(id), null)
returns an emtpy result.

Does anybody have any experience with this kind of situation or any other pointer?

If it is of interest, this is the config file (including osgi.configuration.area):
#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Tue May 14 11:09:34 CEST 2013

Thanks for your help!
Previous Topic:Clean Equinox' cache after uninstallation of bundles
Next Topic:Eclipse RCP app with Worldwind - Globe vanishes
Goto Forum:

Current Time: Tue Oct 26 16:15:49 GMT 2021

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

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

Back to the top