I followed the example on Karaf Cellar as given under, http://blog.nanthrax.net/2011/11/apache-karaf-cellar-and-dosgi/
I created 3 OSGi bundles, namely, service (Bundle1), service-implementation (Bundle2) and client (Bundle3). I have 2 karaf containers running on different machines with (Bundle1) and (Bundle2) deployed on one karaf instance and (Bundle1) and (Bundle3) on other karaf instance. Every thing worked fine as given in the example. I removed the client bundle from the Karaf container2 and wanted to invoke the service via camel route described in blueprint.
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<reference id="myService" interface="org.service.cellar.EchoService" timeout="20000" availability="optional" />
<camelContext id="camel" trace="false"
xmlns="http://camel.apache.org/schema/blueprint">
<route id="client">
<from uri="timer://foo?fixedRate=true&period=10000" />
<bean ref="myService" method="process" />
<log message=" Invoking Service : ${body}" />
</route>
</camelContext>
</blueprint>
As soon as I deployed the above blueprint in karaf container2, i am seeing the following exception in the karaf container 1. I am not able to figure out the source of this error. Any comments regarding this problem is appreciated.
Thank you.
2012-10-15 13:24:40,477 | ERROR | pool-11-thread-7 | EventDispatchTask | 78 - org.apache.karaf.cellar.core - 2.2.4 | Error while dispatching task java.lang.NullPointerException at org.apache.karaf.cellar.dosgi.RemoteServiceCallHandler.handle(RemoteServiceCallHandler.java:74)[83:org.apache.karaf.cellar.dosgi:2.2.4] at org.apache.karaf.cellar.dosgi.RemoteServiceCallHandler.handle(RemoteServiceCallHandler.java:34)[83:org.apache.karaf.cellar.dosgi:2.2.4] at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_35] at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_35] at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50)[7:org.apache.aries.proxy:0.3.1] at org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31)[7:org.apache.aries.proxy:0.3.1] at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78)[7:org.apache.aries.proxy:0.3.1] at $Proxy24.handle(Unknown Source)[78:org.apache.karaf.cellar.core:2.2.4] at org.apache.karaf.cellar.core.event.EventDispatchTask.run(EventDispatchTask.java:77)[78:org.apache.karaf.cellar.core:2.2.4] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_35] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_35] at java.lang.Thread.run(Thread.java:662)[:1.6.0_35]