I have a spring context which exports the osgi service defined under /META-INF/spring/spring-dao.xml like this
<osgi:service ref="stockDao" interface="com.test.StockDao" />`
The question is: I want to use the above defined service in my blueprint, which is defined under location /OSGI-INF/blueprint/blueprint.xml.
<reference id="stockDao" interface="com.test.StockDao" />`
After having this configuration i get following error
java.lang.Exception: Can not resolve feature:
Unsatisfied requirement(s):
---------------------------
service:(service=com.test.StockDao)
Boohoo Database Test
at org.fusesource.fabric.agent.ObrResolver.resolve(ObrResolver.java:215)[67:org.fusesource.fabric.fabric-agent:7.2.0.redhat-024]
at org.fusesource.fabric.agent.DeploymentAgent.updateDeployment(DeploymentAgent.java:566)[67:org.fusesource.fabric.fabric-agent:7.2.0.redhat-024]
at org.fusesource.fabric.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:432)[67:org.fusesource.fabric.fabric-agent:7.2.0.redhat-024]
at org.fusesource.fabric.agent.DeploymentAgent$1.run(DeploymentAgent.java:242)[67:org.fusesource.fabric.fabric-agent:7.2.0.redhat-024]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)[:1.6.0_43]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_43]
at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_43]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)[:1.6.0_43]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)[:1.6.0_43]
at java.lang.Thread.run(Thread.java:662)[:1.6.0_43]
Currently, osgi service exported in spring beans could be referenced only by spring beans. On the other side, service exported by blueprint could be referenced only by another blueprint.
Correct me if am getting it wrong? If this is possible how do I do it.
com.test.StockDaoservice from one bundle (probably by statically analysing the Blueprint XML... difficult to tell) but it is not finding the corresponding capability in the bundle that should provide it. You should probably take this to the FuseSource forums for specific help there. - Neil Bartlett