[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Debug ECF remote services

Hi Scott,

I've been experimenting a bit more with my code and found an interesting ECF behavior. Say I have three hosts (host1, host2, host3) and a consumer C. The hosts provide a remote service which is supposed to be used by the consumer.

1. I connect host1, host2 and consumer. host1 & 2 register remote services to consumer. The console output for host 1 & 2 says the registration process was correct but my consumer can not retrieve the previously registered services neither for host1 nor for host2.

2. now I connect host3 and voila my consumer is able to retrieve services from all  hosts 1, 2 and host3. Do you have an idea what's wrong here? What works for three hosts doesn't work for two hosts. 

3. the curiosity is not over yet. When my consumer tries to retrieve remote services for his containerID the last connected host always offers to many service references. The size of the returned service references corresponds to the totally amount of users registered to the XMPP server. When I connect host1, 2, consumer, host3: host 1 & 2 return in each case one service reference, host3 returns 4. The whole situation is pretty weird and sometimes the problems are not reproducible. 


Am Jul 2, 2010 um 18:57  schrieb Scott Lewis:

Hi Eugen,

Eugen Reiswich wrote:
Hi Scott,

Below are some of the runtime hooks for the ECF remote services API specifically . There are also runtime hooks for the discovery API, as well as for the OSGi Remote Services implementation (for both discovery and distribution).  I won't list those hooks here, but some of them are listed on this wiki page:  http://wiki.eclipse.org/Discovery_and_Distribution_Listeners
I tried this hook but even though my listeners are registered properly the listeners are very quite - they don't do anything.

That's probably because your service registration is not properly formed (for the XMPP provider?).

IRemoteServiceContainerAdapter.addRemoteServiceListener:  It's possible to add listeners to remote service events...e.g. registration, unregistration, etc.

IRemoteServiceContaienrAdapter.getAllRemoteServiceReferences:  It's possible to get parts/all of the local remote service registry.

I already use the first hook (addRemoteServiceListener) but the second one does not work as I always get an empty result list. In addition to that getAllRemoteServiceReferences requires as a parameter a specific service. In my case I would like to know whether any remote service is available.


but the bug below prevents this from working at the moment

What I always get is the following exception: java.lang.NullPointerException
at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject.getAllRemoteServiceReferences(RegistrySharedObject.java:163)
at org.remotercp.ecf.consumer.test.ServiceConsumer._getService(ServiceConsumer.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)
at java.lang.Thread.run(Thread.java:637)

I tried to debug this exception but all I found out is that within the ECF-RegistrySharedObject the map "remoteRegistries" is empty. But I don't know why.

It's empty because the clients never receive the service registration (probably because the registration is not properly formed).

I've created this entry for the above bug, however...which has to do with the case when remoteRegistries is completely empty (which it is in your case).  https://bugs.eclipse.org/bugs/show_bug.cgi?id=318756


ecf-dev mailing list