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

Guillaume Nodet edited comment on KARAF-3520 at 6/8/15 7:17 AM:
----------------------------------------------------------------

I agree, that's why I have no problems with adding a static global flag to 
change the behaviour.

The RSA use case is interesting.  If I had such a case, I would model the 
features in order to reflect that, rather than avoiding to add the metadata to 
work around this use case.  What I mean is that the more accurate the metadata 
is, the better provisioning result you'll have at the end.
If you simply hide the fact that there is a service requirement, you will 
certainly end up with users deploying the feature and yelling about it not 
working without actually knowing why exactly.  If you leave the service 
requirement, you force the user to either deploy a real future in the same OSGi 
framework providing the required service, but it could also be a dummy feature 
to indicate that the service will be provided via RSA

{code}
<feature name="my-remote-service">
        <capability>
            
osgi.service;effective:=active;objectClass=org.apache.aries.proxy.ProxyManager
        </capability>
</feature>
{code}

This would install no additional bundles, provide the needed service for the 
resolution, keep the metadata correct, and the user would be aware, by 
installing this feature, that the service has to be actually provided remotely.


was (Author: gnt):
I agree, that's why I have no problems with adding a static global flag to 
change the behaviour.

The RSA use case is interesting.  If I had such a case, I would model the 
features in order to reflect that, rather than avoiding to add the metadata to 
work around this use case.  What I mean is that the more accurate the metadata 
is, the better provisioning result you'll have at the end.
If you simply hide the fact that there is a service requirement, you will 
certainly end up with users deploying the feature and yelling about it not 
working without actually knowing why exactly.  If you leave the service 
requirement, you force the user to either deploy a real future in the same OSGi 
framework providing the required service, but it could also be a dummy feature 
to indicate that the service will be provided via RSA

<feature name="my-remote-service">
        <capability>
            
osgi.service;effective:=active;objectClass=org.apache.aries.proxy.ProxyManager
        </capability>
</feature>

This would install no additional bundles, provide the needed service for the 
resolution, keep the metadata correct, and the user would be aware, by 
installing this feature, that the service has to be actually provided remotely.

> FeatureService fails to install feature in case of missing capability
> ---------------------------------------------------------------------
>
>                 Key: KARAF-3520
>                 URL: https://issues.apache.org/jira/browse/KARAF-3520
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-feature
>    Affects Versions: 4.0.0.M1
>            Reporter: Achim Nierbeck
>            Priority: Critical
>             Fix For: 4.0.0
>
>
> If a bundle does contain a require-capability header for example like the 
> following: 
> {code}
> osgi.service; effective:=active; 
> filter:="(objectClass=org.ops4j.pax.url.mvn.MavenResolver)"]]
> {code}
> but there is no bundle satisfying this capability the installation of this 
> feature fails: 
> {code}
> org.osgi.service.resolver.ResolutionException: Unable to resolve root: 
> missing requirement [root] osgi.identity; osgi.identity=mybundle; 
> type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; 
> filter:="(&(osgi.identity=mybundle)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))"
>  [caused by: Unable to resolve mybundle/1.0.0.SNAPSHOT: missing requirement 
> [mybundle/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=com.my.package; 
> type=osgi.bundle; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; 
> resolution:=mandatory [caused by: Unable to resolve 
> com.my.package/1.0.0.SNAPSHOT: missing requirement 
> [com.my.package/1.0.0.SNAPSHOT] osgi.service; effective:=active; 
> filter:="(objectClass=org.ops4j.pax.url.mvn.MavenResolver)"]]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:285)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:454)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:266)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.Candidates.populate(Candidates.java:153)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:148)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:186)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:254)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1028)[6:org.apache.karaf.features.core:4.0.0.M2]
> at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:929)[6:org.apache.karaf.features.core:4.0.0.M2]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_25]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_25]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_25]
> at java.lang.Thread.run(Thread.java:745)[:1.8.0_25]
> {code}
> The installation of the bundle works from the shell via a bundle:install 
> without issues, the resolving of the bundle also works. 
> The feature service should handle missing capabilities more graceful. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to