Thanks a lots Christian , The issue was due to the interface class getting packed in other jars also, due to an error in the pom.xml maven-bundle-plugin instruction.
Cheers Jens From: Christian Schneider [mailto:[email protected]] On Behalf Of Christian Schneider Sent: 14 July 2014 17:21 To: [email protected] Subject: Re: Service lookup error This indeed looks like you have the interface package in multiple bundles. Please check your Manifests and the contents of the jars. headers <bundleid> should help you. Christian On 14.07.2014 13:43, Jens J Parappallil wrote: Hi, I am using karaf 3.0.1 with osgi framework equinox . I have a simple service getting exposed via interface (com.ibsplc.icx.mx.core.ICXIdentity ) from one bundle and being looked up from another. This was working initially and now all of a sudden this service is not getting picked up . This is the output from diag and subsequent service:list command karaf@icx-node $diag 222 iCx Message Exchange Inbound Adaptor (222) ------------------------------------------ Status: GracePeriod Blueprint 14/7/14 4:53 PM Missing dependencies: (objectClass=com.ibsplc.icx.mx.core.ICXIdentity) Bundle 222 is waiting for the service but the same is already published ... karaf@icx-node $service:list com.ibsplc.icx.mx.core.ICXIdentity [com.ibsplc.icx.mx.core.ICXIdentity] ------------------------------------ osgi.service.blueprint.compname = identityProvider type = iCxIdentity domain = icx service.id = 982 Provided by : iCx Message Exchange Core (220) I switched the Osgi framework to felix which resulted in classcast exeception on the proxy Caused by: java.lang.ClassCastException: Proxyf21e058d_4048_4147_b33d_e304803b636a cannot be cast to com.ibsplc.icx.mx.core.ICXIdentity at com.ibsplc.icx.mx.inbound.TestInit.start(TestInit.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_03] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_03] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_03] This seems to be a classloader accessibility issue but what is causing this, both the interface and impl class are present only in one bundle ( 220 ) . Please help :) Thanks Jens -- Christian Schneider http://www.liquid-reality.de Open Source Architect http://www.talend.com DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."
