Exception using RemoteServices [message #1044228] |
Thu, 18 April 2013 16:38 |
Robert Onslow Messages: 13 Registered: April 2010 |
Junior Member |
|
|
I am using a container for both remote services and distributed event admin:
final IRemoteServiceContainerAdapter rsc = (IRemoteServiceContainerAdapter) ((IAdaptable) container).getAdapter(IRemoteServiceContainerAdapter.class);
rsc.addRemoteServiceListener(new IRemoteServiceListener() {
@Override
public void handleServiceEvent(IRemoteServiceEvent event) {
String targetClass = StateProvider.class.getName();
String[] clazzes = event.getClazzes();
boolean quit = false;
for (int i = 0; !quit && i < clazzes.length; i++)
quit = clazzes[i].equals(targetClass);
if (quit) try {
IRemoteServiceReference ref = event.getReference();
IRemoteService rs = rsc.getRemoteService(ref);
IRemoteCall call = new RemoteCall("provideState");
Map<String, Object> state = (Map<String, Object>) rs.callSync(call);
syncBundles(state);
} catch (Exception x) {Log.log(Log.ERROR, x.getMessage());
disconnect();}
}
});
final ISharedObjectContainer soc = (ISharedObjectContainer) ((IAdaptable) container).getAdapter(ISharedObjectContainer.class);
soc.addListener(new IContainerListener() {
@Override
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent)
try {
ISharedObjectManager manager = soc.getSharedObjectManager();
admin = new DistributedEventAdmin(context);
ID id1 = IDFactory.getDefault().createStringID("uk.co.xlegal.xbundle3.remote");
Properties props = new Properties();
props.put(EventConstants.EVENT_TOPIC, "uk_co_xlegal_xbundle3_remote");
manager.addSharedObject(id1, (ISharedObject) admin, props);
((DistributedEventAdmin) admin).start();
} catch (Exception e) {
Log.log(Log.ERROR, e.getMessage());
}
}
});
container.connect(id, null);
DistributedEventAdmin works fine, but I am getting the following exception thrown on the call to container.connect() which is preventing the callback to handleServiceEvent of IRemoteServiceListener:
java.lang.NoClassDefFoundError: org/eclipse/ecf/remoteservice/IRemoteServiceCallPolicy
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2440)
at java.lang.Class.getDeclaredMethods(Class.java:1806)
at org.eclipse.ecf.core.util.reflection.ClassUtil.getDeclaredMethod(ClassUtil.java:62)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.findMethod(SharedObjectMsg.java:156)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.findMethodRecursive(SharedObjectMsg.java:188)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.findMethodRecursive(SharedObjectMsg.java:286)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.doInvoke(SharedObjectMsg.java:301)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.invoke(SharedObjectMsg.java:290)
at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject.handleSharedObjectMsg(RegistrySharedObject.java:1767)
at org.eclipse.ecf.core.sharedobject.BaseSharedObject.handleSharedObjectMsgEvent(BaseSharedObject.java:455)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsgEventProcessor.processSharedObjectMsgEvent(SharedObjectMsgEventProcessor.java:41)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsgEventProcessor.processEvent(SharedObjectMsgEventProcessor.java:36)
at org.eclipse.ecf.core.sharedobject.BaseSharedObject.fireEventProcessors(BaseSharedObject.java:190)
at org.eclipse.ecf.core.sharedobject.BaseSharedObject.handleEvent(BaseSharedObject.java:126)
at org.eclipse.ecf.provider.generic.SOWrapper.svc(SOWrapper.java:182)
at org.eclipse.ecf.provider.generic.SOWrapper$2.run(SOWrapper.java:138)
at java.lang.Thread.run(Thread.java:717)
Caused by: java.lang.ClassNotFoundException: org.eclipse.ecf.remoteservice.IRemoteServiceCallPolicy
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:355)
... 18 more
I have dependencies on both SharedObject and RemoteService in my bundle.
Any ideas?
Thanks
Robert
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03692 seconds