ops4j / org.ops4j.pax.cdi

Contexts and Dependency Injection for OSGi
Apache License 2.0
34 stars 26 forks source link

Missing Provide-Capability in pax-cdi-extender [PAXCDI-226] #269

Closed ops4j-issues closed 8 years ago

ops4j-issues commented 8 years ago

John Poth created PAXCDI-226

pax-cdi-extender correctly declares the following requirement in it's MANIFEST:

Require-Capability: ...,osgi.service;effective:=active;filter:="(objectClass=javax.ent
erprise.inject.spi.CDIProvider)"

But it is also the provider of that requirement and fails to declare it in it's MANIFEST.

This causes the following error when installing the new pax-cdi-weld feature in FUSE:

 org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=deltaspike-core; type=karaf.feature; version=1.5.1 [caused by: Unable to resolve deltaspike-core/1.5.1: missing requirement [deltaspike-core/1.5.1] osgi.identity; osgi.identity=org.apache.deltaspike.core.deltaspike-core-impl; type=osgi.bundle; version="[1.5.1,1.5.1]"; resolution:=mandatory [caused by: Unable to resolve org.apache.deltaspike.core.deltaspike-core-impl/1.5.1: missing requirement [org.apache.deltaspike.core.deltaspike-core-impl/1.5.1] osgi.extender; filter:="(osgi.extender=pax.cdi)" [caused by: Unable to resolve org.ops4j.pax.cdi.extender/1.0.0.RC1: missing requirement [org.ops4j.pax.cdi.extender/1.0.0.RC1] osgi.service; effective:=active; filter:="(objectClass=javax.enterprise.inject.spi.CDIProvider)"]]]
          at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)
          at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:236)

This also causes any feature depending on pax-cdi-weld to fail (e.g switchyard-bean).


Affects: 1.0.0.RC1 Fixed in: 1.0.0.RC2 Votes: 0, Watches: 2

ops4j-issues commented 8 years ago

John Poth commented

PR provided.

ops4j-issues commented 8 years ago

Guillaume Nodet commented

Could you double-check with the following patch instead :

diff --git a/pax-cdi-parent/pom.xml b/pax-cdi-parent/pom.xml
index 788f61f..fa3cc25 100644
--- a/pax-cdi-parent/pom.xml
+++ b/pax-cdi-parent/pom.xml
@@ -352,6 +352,7 @@
                 <plugin>
                     <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
+                    <version>3.0.1</version>
                     <extensions>true</extensions>
                     <configuration>
                         <unpackBundle>true</unpackBundle>                
ops4j-issues commented 8 years ago

Guillaume Nodet commented

Fixed with https://github.com/ops4j/org.ops4j.pax.cdi/commit/120b5198dff7458826bc7a3a9aa1be3a7f693fda