karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-4730) Feature not installed - missing requirement osgi.service; effective:=active; filter
Date Tue, 27 Jun 2017 16:00:00 GMT

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

Guillaume Nodet commented on KARAF-4730:
----------------------------------------

You deploy the features without the DB service being available ?

Here are a few untested work arounds:
  * put a dependency on a feature which actually provide this service
  * put a dependency on a feature with a virtual capability providing this service:
{code}
<feature name="myDB">
  <capability>osgi.service; objectClass=javax.sql.DataSource; osgi.jndi.service.name=myDB</capability>
</feature>
{code}
  * use an older feature namespace (<= 1.2.1), in which case, Karaf should not try to validate
service dependencies for compatibility with previous features 
  * use <_removeheaders>Require-Capability</_removeheaders>
  * set serviceRequirements=disable in etc/org.apache.karaf.features.cfg (global behavior)


> Feature not installed -  missing requirement osgi.service; effective:=active; filter
> ------------------------------------------------------------------------------------
>
>                 Key: KARAF-4730
>                 URL: https://issues.apache.org/jira/browse/KARAF-4730
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.0.6
>            Reporter: Jirka
>
> I have a feature that works correctly on Karaf 4.0.5. When I try to install it on Karaf
4.0.6, I get an error.
> {code}
> 2016-09-24 16:03:56,955 | ERROR | nsole user karaf | ShellUtil                      
 | 43 - org.apache.karaf.shell.core - 4.0.6 | Exception caught while executing command
> org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement
[root] osgi.identity; osgi.identity=myapp; type=karaf.feature; version="[1.4.0.SNAPSHOT,1.4.0.SNAPSHOT
> ]"; filter:="(&(osgi.identity=myapp)(type=karaf.feature)(version>=1.4.0.SNAPSHOT)(version<=1.4.0.SNAPSHOT))"
[caused by: Unable to resolve myapp/1.4.0.SNAPSHOT: missing requirement [myapp/1
> .4.0.SNAPSHOT] osgi.identity; osgi.identity=com.myapp.mybundle; type=osgi.bundle; version="[1.4.0.SNAPSHOT,1.4.0.SNAPSHOT]";
resolution:=mandatory [caused by: Unable to resolve com.myapp.mybundle/1.4.0.SNAPSHOT: missing
requirement [com.myapp.mybundle/1.4.0.SNAPSHOT] osgi.service; effective:=active; filter:="(&(objectClass=javax.sql.DataSource)(osgi.jndi.service.n
> ame=myDB))"]]
>         at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[8:org.apache.karaf.features.core:4.0.6]
>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:235)[8:org.apache.karaf.features.core:4.0.6]
>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:158)[8:org.apache.karaf.features.core:4.0.6]
>         at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[8:org.apache.karaf.features.core:4.0.6]
>         at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[8:org.apache.karaf.features.core:4.0.6]
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[8:org.apache.karaf.features.core:4.0.6]
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[8:org.apache.karaf.features.core:4.0.6]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_92]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_92]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_92]
>         at java.lang.Thread.run(Thread.java:745)[:1.8.0_92]
> {code} 
> The feature has a bundle com.myapp.mybundle with a blueprint file with a reference to
a service registered earlier.
>  
> {code}
> 	<reference id="dataSourceRef" interface="javax.sql.DataSource" filter="(osgi.jndi.service.name=myDB)"
/>
> {code}
> The service is registered correctly with the required interface and property.
> When I install the bundle manually from the Karaf shell, it installs correctly.
> When I remove the filter from the blueprint reference, 
> <reference id="dataSourceRef" interface="javax.sql.DataSource" 
> -filter="(osgi.jndi.service.name=myDB)"- />
> both the feature and the bundle install correctly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message