Thank you for the answer Guillaume and David!

We were using maven-bundle-plugin (2.5.x) for building the bundles.
Switching to the latest version of the plugin (3.2.0) changes the things: the Provide-Capability/Require-Capability headers no longer contain service properties for filters, but only objectClass attribute.
I will verify on our side in how far such an upgrade can be done.

Thank you once again, so far I have solutions for the issue!

Kind regards

On Wed, 12 Oct 2016 20:13:54 +0200, Guillaume Nodet <> wrote:

The bnd plugin from the maven bundle plugin used to do that:
I think it's now disabled by default and the bnd one is used.

Maybe an upgrade of the maven bundle plugin would fix the problem ?

2016-10-12 19:41 GMT+02:00 David Jencks <>:
What is generating the Require-Capabiility header? The target filter isn’t supposed to be there on either Provide- or Require-Capability since it can >>generally be overridden by configuration. AFAICT the bnd DS processing doesn’t add the target filter to the Require-Capability header.

david jencks

On Oct 12, 2016, at 4:30 AM, Sergiy Shyrkov <> wrote:

Hello guys,

we are migrating from Karaf 4.0.5 to 4.0.7 and facing a small issue with the feature resolution. I know that in Karaf 4.0.6 the enforcement of service capabilities when feature is installed became effective.
But in our case we use a filter when consuming the service.

In Java code using DS it looks as follows (we are consuming a service, exposed by org.apache.karaf.cellar.bundle):

@Reference(service = Synchronizer.class, target = "(resource=bundle)") protected void bindCellarBundleSynchronizer(Synchronizer cellarBundleSynchronizer) {
       this.cellarBundleSynchronizer = cellarBundleSynchronizer;

and it results in the following header in MANIFEST.MF:

Require-Capability: osgi.service;effective:=active;filter:="(&objectClass=org.apache.karaf.cellar.core.Synchronizer)(resource=bundle))"

Note that the filter apart from standard objectClass contains also the "(resource=bundle)" clause.
And this is the culprit in our case.
Because of that clause our feature fails the installation now:

org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=dx-clustering; >>type=karaf.feature; version="[,]"; filter:="(&(osgi.identity=dx-clustering)(type=karaf.feature)>>(version>=<=" [caused by: Unable to resolve dx-clustering/ missing >>requirement [dx-clustering/] osgi.identity; osgi.identity=org.jahia.bundles.clustering; type=osgi.bundle; version="[>>SNAPSHOT,]"; resolution:=mandatory [caused by: Unable to resolve org.jahia.bundles.clustering/ missing >>requirement [org.jahia.bundles.clustering/] osgi.service; effective:=active; filter:="(&>>(objectClass=org.apache.karaf.cellar.core.Synchronizer)(resource=bundle))"]] at org.apache.felix.resolver.ResolutionError.toException( at org.apache.felix.resolver.ResolverImpl.resolve( at org.apache.felix.resolver.ResolverImpl.resolve( at org.apache.karaf.features.internal.region.SubsystemResolver.resolve( at org.apache.karaf.features.internal.service.Deployer.deploy( at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision( at org.apache.karaf.features.internal.service.FeaturesServiceImpl$
at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$

The resolution issue is only a feature level.
When I am installing/starting the bundle alone I do not have the issue.

I was able to workaround the issue by overriding the cellar-bundle feature in our descriptor and providing explicit capability for that service with >>the resource=bundle property, i.e.:

   <feature name="dx-cellar-bundle" ...>

But I would like to ask for help and advice about the proper handling, please. Are we doing something wrong? Is there a better way to let feature resolver work with service filters more accurately?

Thank you in advance!

Kind regards

Sergiy Shyrkov
Software Architect
Jahia Solutions Group SA

Guillaume Nodet
Red Hat, Open Source Integration


Sergiy Shyrkov
Software Architect
Jahia Solutions Group SA

Reply via email to