Bug 496557 - Uses constraint violation when trying to exchange equinox.ds with felix.scr
Summary: Uses constraint violation when trying to exchange equinox.ds with felix.scr
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.7 M1   Edit
Assignee: Dirk Fauth CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2016-06-22 10:27 EDT by Dirk Fauth CLA
Modified: 2016-06-29 09:10 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Fauth CLA 2016-06-22 10:27:28 EDT
With Bug 481449 it was tried to make the SCR implementation exchangeable. Unfortunately this doesn't work with Eclipse RCP applications.

The reason is one of the most discussed dependency issues in OSGi: Require-Bundle vs. Import-Package

If I remove equinox.ds from the run configuration and add felix.scr I get a "Uses constraint violation"

org.eclipse.e4.ui.workbench.swt has a dependency defined to org.eclipse.osgi.services, which exposes org.osgi.service.component. The same is exportet by org.apache.felix.scr.

The org.eclipse.osgi.service bundle seems to provide the collected available service interfaces from the compendium. org.apache.felix.scr provides the same especially for compendium.

We really need to get better in specifying dependencies to OSGi stuff and NEVER Require-Bundle org.eclipse.osgi.services and probably not even org.eclipse.osgi.

As I have something running to test, I will try to provide a patch for this.

For completeness, here is one part of the quite long error message from the resolver:

Uses constraint violation. Unable to resolve resource org.eclipse.e4.ui.workbench.swt [osgi.identity; type="osgi.bundle"; version:Version="0.14.0.v20160518-1929"; osgi.identity="org.eclipse.e4.ui.workbench.swt"; singleton:="true"] because it is exposed to package 'org.osgi.service.component' from resources org.eclipse.osgi.services [osgi.identity; type="osgi.bundle"; version:Version="3.5.100.v20160504-1419"; osgi.identity="org.eclipse.osgi.services"] and org.apache.felix.scr [osgi.identity; osgi.identity="org.apache.felix.scr"; type="osgi.bundle"; version:Version="2.0.2"] via two dependency chains.
Comment 1 Eclipse Genie CLA 2016-06-22 17:04:11 EDT
New Gerrit change created: https://git.eclipse.org/r/75780
Comment 2 Dirk Fauth CLA 2016-06-22 17:28:08 EDT
I replaced require bundle with import package for the platform bundles where I have found them. All of them simply have that dependency because of org.osgi.service.event.

I didn't touch the test plugins yet, as there is still the dependency issue pending regarding tycho surefire tests. This needs to be cleaned up first.

Afterwards we should also create a ticket to cleanup the dependencies in general. I have found some unused dependencies and IMHO that should be cleaned up aswell.
Comment 4 Dirk Fauth CLA 2016-06-29 05:40:13 EDT
Fixed with applied patch to change Require-Bundle org.eclipse.osgi.services to Import-Package for org.osgi.service.event
Comment 5 Lars Vogel CLA 2016-06-29 09:10:32 EDT
> Unfortunately this doesn't work with Eclipse RCP applications.

I think that is N&N for RCP customers. Dirk, can you add this to the N&N M1?