context-class-loader attribute on osgi reference
On osgi service side ,when setting this attribute to service-provider ,I was able to initialize a class present in bundle providing the service using TCCL from withing service reference .
Code on service side:
Code:
<osgi:service id="service" interface="com.pg.ccl.intf.ServiceIntf" context-class-loader="service-provider" ref="serviceBean"></osgi:service>
Thread.currentThread().getContextClassLoader().loadClass("com.pg.serviceCCL.Dummy").newInstance();
But after going through the doc it seems we can specify the same attribute on osgi reference and same should work .But instead i am getting CNF Exception.
Have i interpreted it incorrectly.