Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] problems with XMPPContainer and IRemoteServiceContainerAdapter

Hi Eugen,

This exception is caused by the combination of a) the xmpp provider's limitation of not being able to handle sending a message to 'null'; b) the use of null in XMPP Registry (RegistrySharedObject)...i.e. this line in the stack below

at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject.sendRegistryUpdateRequest(RegistrySharedObject.java:819)

This is probably caused by the ordering in your code WRT initialization/connecting of the XMPP client...my guess is that your ordering is:

1) Create client container
2) connect the client container
3) call container.getAdapter(IRemoteServiceContainerAdapter.class);
(and this triggers the exception...would be my guess)
4) use the IRemoteServiceContainerAdapter somehow (register or get)

To avoid this exception for the XMPP container the order should be:

1) Create client container
2) call container.getAdapter(IRemoteServiceContainerAdapter.class)
3) connect the container
4) use the adapter

This ordering should prevent this exception for the xmpp container.  This is the ordering in the test code, and it works fine.

The underlying reason for all this startup order complication for the XMPP container is that XMPP has no notion of the *group* that registry updates should be sent to (i.e. the meaning of 'null' for sendRegistryUpdateRequest).    This should perhaps be changed...e.g. to have the 'group' be defined as the (e.g.) active members on your roster...but there isn't a lot of current, active development on the xmpp provider right now...as I haven't been able to dedicate resources to it.

In the short terrm, if you can't change your existing code, it might be possible to modify things for xmpp-based remote services via this class

org.eclipse.ecf.internal.provider.xmpp.XMPPRemoteServiceAdapterFactory.XMPPRegistrySharedObject

but I would need to look at it more carefully before saying for sure.

Scott

On 10/14/2010 9:12 AM, Eugen Reiswich wrote:
Hi Scott, hi Markus, 

I just realized that the bundle you both mentioned is in the new Git Repo but not in CVS. I just imported from Git: compendium, framework, protocols and providers (btw. is there an easier way to do this e.g. something comparable to projects sets a la releng/org.eclipse.ecf.releng?). 

When I launch my application and try to retrieve a remote service I get the following exception:

[log;+0200 2010.10.14 18:05:48:46;ERROR;org.eclipse.ecf.provider.remoteservice;org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.provider.remoteservice;code=210;message=Exception sending response;severity4;exception=java.io.IOException: receiver cannot be null for xmpp instant messaging;children=[]]]
java.io.IOException: receiver cannot be null for xmpp instant messaging
at org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection.sendMessage(ECFConnection.java:372)
at org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection.sendAsynch(ECFConnection.java:363)
at org.eclipse.ecf.provider.generic.ClientSOContainer.queueContainerMessage(ClientSOContainer.java:310)
at org.eclipse.ecf.provider.generic.SOContainer.sendMessage(SOContainer.java:961)
at org.eclipse.ecf.provider.generic.ClientSOContainer.sendMessage(ClientSOContainer.java:362)
at org.eclipse.ecf.provider.generic.SOContainer.sendSharedObjectMessage(SOContainer.java:1037)
at org.eclipse.ecf.provider.generic.ClientSOContainer.sendSharedObjectMessage(ClientSOContainer.java:434)
at org.eclipse.ecf.provider.generic.SOContainer.sendMessage(SOContainer.java:1033)
at org.eclipse.ecf.provider.generic.ClientSOContainer.sendMessage(ClientSOContainer.java:426)
at org.eclipse.ecf.provider.generic.SOContext.sendMessage(SOContext.java:230)
at org.eclipse.ecf.core.sharedobject.BaseSharedObject.sendSharedObjectMsgTo(BaseSharedObject.java:358)
at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject.sendRegistryUpdateRequest(RegistrySharedObject.java:819)
at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject$1.processEvent(RegistrySharedObject.java:408)
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:185)
at org.eclipse.ecf.provider.generic.SOWrapper$2.run(SOWrapper.java:138)
at java.lang.Thread.run(Thread.java:637)

Eugen


Am 14.10.2010 um 17:35 schrieb Scott Lewis:

On 10/14/2010 8:25 AM, Markus Alexander Kuppe wrote:
On 10/14/2010 05:17 PM, Eugen Reiswich wrote:
Hi folks,

I'm trying to use remote services over ECF with the XMPP provider. In
order to register and retriever remote services I need to get the
IRemoteServiceContainerAdapter:
IPresenceContainerAdapter adapter = (IPresenceContainerAdapter)
this.container
.getAdapter(IPresenceContainerAdapter.class);

I'm running in a NPE. Debugging the ECF-Code I found out that
the XMPPContainer returns null
providing org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter as clazz
parameter.


public Object getAdapter(Class clazz) {
if (clazz.equals(IPresenceContainerAdapter.class))
return this;
if (clazz.equals(ISendFileTransferContainerAdapter.class))
return outgoingFileTransferContainerAdapter;
else
return super.getAdapter(clazz);
}

Btw. the IPresenceContainerAdapter works fine. Any idea?
Has the org.eclipse.ecf.provider.xmpp.remoteservice bundle been deployed
and registered?

Just to follow up with an explanation of why this fragment is necessary:  the xmpp.remoteservice bundle re-uses the ECF generic implementation of the IRemoteServiceContainerAdapter...it does this by creating an IAdapterFactory extension (specifically, XMPPRemoteServiceAdapterFactory).

This extension is then processed and used to respond with non-null IRemoteServiceContainerAdapter in the return super.getAdapter(clazz); in the XMPPContainer impl of getAdapter(Class clazz).

So that fragment is now necessary (along with it's dependency on org.eclipse.ecf.provider.remoteservice) to get/use the IRemoteServiceContainerAdapter for xmpp.

Scott



Markus
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev

_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev

_______________________________________________ ecf-dev mailing list ecf-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ecf-dev


Back to the top