I appreciate any help I can get.

I have an instantiation of a class called SnapshotReader using the config file: 
com.navsys.tidgetsaasm.gatewaymanager.localsnapshotmanager.SnapshotReader-LocalStore.cfg

The class SnapshotReader @Provides the services TidgetSaasmDevice and Service.

In my GUI Class I @Require(optional=false) a TidgetSaasmDevice that is 
implemented by SnapshotReader. (I know this using the Felix WebConsole ).

When I try to cast the TidgetSaasmDevice(implemented by a SnapshotReader) into 
a SnapshotReader I get the exception(at Runtime):
        Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: 
com.navsys.tidgetsaasm.gatewaymanager.tidgetdevice.TidgetSaasmDevice$$Proxy 
cannot be cast to 
com.navsys.tidgetsaasm.gatewaymanager.localsnapshotmanager.SnapshotReader
At the line: SnapshotReader templocalstoretidget = (SnapshotReader) 
snapshotreadertidget;

Another Felix develeoper recommended I used 
bundleContext.getServiceReference(SnapshotReader.class.name()) to get the 
instantiation instead, since the Proxy is not doing it for me.
It returns null, but 
bundleContext.getServiceReference(TidgetSaasmDevice.class.getName()) works just 
fine.

I have confirmed for myself that a SnapshotReader instance does exist using the 
Felix WebConsole

Is there something I am missing or can do to get this instance as a 
SnapshotReader?

Thank you,

Mark-Anthony Hutton

Reply via email to