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

Viktor Kozlov commented on KARAF-4730:
--------------------------------------

When I install the feature required service is available.
I've tested <_removeheaders>Import-Service</_removeheaders> solution before 
your answer. It helps.
DataSource service provided by pax-jdbc in my case.

> 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
>            Assignee: Guillaume Nodet
>
> 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)

Reply via email to