[ 
https://issues.apache.org/jira/browse/KARAF-6625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17169196#comment-17169196
 ] 

David Jencks commented on KARAF-6625:
-------------------------------------

I agree that it could be useful to have those two attributes on the component 
factory service. The reason for not adding the other service properties, IIRC, 
was that they can be reset by configuration; since these two can't be reset, it 
makes some sense to include them.  In any case, you should talk about this idea 
on the bnd list, there's nothing Karaf can do about it.

It's possible that I didn't try to implement this idea because I'd never found 
a use for component factories :).... since you seem to have, perhaps that will 
be an argument towards implementing it.

> feature:install fails for bundles with SCR Factory Components
> -------------------------------------------------------------
>
>                 Key: KARAF-6625
>                 URL: https://issues.apache.org/jira/browse/KARAF-6625
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.8
>            Reporter: Robert Varga
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> This issue has been reported in the thread here: 
> [https://mail-archives.apache.org/mod_mbox/karaf-user/201809.mbox/%3c224b2d59-43ca-f01c-ea77-b2f7ba2a7...@nanthrax.net%3e]
> If a bundle is created using stock maven-bundle-plugin (4.2.1), without 
> specifying:
> {noformat}
> <_dsannotations-options>norequirements</_dsannotations-options>{noformat}
> and is using Factory Components 
> ([https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#d0e39673]
>  , but it works the same way for R6), it results in MANIFEST.MF containing:
> {noformat}
> Require-Capability: 
> osgi.service;filter:="(objectClass=org.osgi.service.component.ComponentFactory)";effective:=active
> {noformat}
> This is not handled properly at feature:install time and resulting in:
> {noformat}
> karaf@root()> feature:install odl-mdsal-binding-runtime 
> org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: 
> missing requirement [root] osgi.identity; 
> osgi.identity=odl-mdsal-binding-runtime; type=karaf.feature; 
> version="[6.0.0.SNAPSHOT,6.0.0.SNAPSHOT]"; 
> filter:="(&(osgi.identity=odl-mdsal-binding-runtime)(type=karaf.feature)(version>=6.0.0.SNAPSHOT)(version<=6.0.0.SNAPSHOT))"
>  [caused by: Unable to resolve odl-mdsal-binding-runtime/6.0.0.SNAPSHOT: 
> missing requirement [odl-mdsal-binding-runtime/6.0.0.SNAPSHOT] osgi.identity; 
> osgi.identity=org.opendaylight.mdsal.binding-runtime-osgi; type=osgi.bundle; 
> version="[6.0.0.SNAPSHOT,6.0.0.SNAPSHOT]"; resolution:=mandatory [caused by: 
> Unable to resolve org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT: 
> missing requirement 
> [org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT] osgi.service; 
> filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; 
> effective:=active]]
>         at 
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
>         at 
> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:392)
>         at 
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:378)
>         at 
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:332)
>         at 
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>         at 
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:393)
>         at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
>         at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
>         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>         at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>         at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>         at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
> resolve odl-mdsal-binding-runtime/6.0.0.SNAPSHOT: missing requirement 
> [odl-mdsal-binding-runtime/6.0.0.SNAPSHOT] osgi.identity; 
> osgi.identity=org.opendaylight.mdsal.binding-runtime-osgi; type=osgi.bundle; 
> version="[6.0.0.SNAPSHOT,6.0.0.SNAPSHOT]"; resolution:=mandatory [caused by: 
> Unable to resolve org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT: 
> missing requirement 
> [org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT] osgi.service; 
> filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; 
> effective:=active]
>         at 
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
>         ... 12 more
> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
> resolve org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT: missing 
> requirement [org.opendaylight.mdsal.binding-runtime-osgi/6.0.0.SNAPSHOT] 
> osgi.service; 
> filter:="(objectClass=org.osgi.service.component.ComponentFactory)"; 
> effective:=active
>         at 
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
>         ... 13 more
> {noformat}
> Adding above _dsannotations-options supresses the manifest entry and 
> everything works as expected.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to