Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » Interface & Session problem
Interface & Session problem [message #650188] Sat, 22 January 2011 16:57 Go to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
Hello guys,

Im quite new about ECF and there is not many docs about that and i runed into some problems. First problem is about interfaces. I have two interfaces A and B extends A. Now i register remote service which implements B. When i call remote methods from interface B everything works fine but when i call anything from A i got NoSuchMethod exception. Anybody knows what is the problem? I use 'generic server and generic client' containers.

Second problem is harder (at least for me). I have server and client and i need client to login first to be able to use my service API. How i can make client identificable from server side when he call any remote methods? I dont wanna put any sessionId togather wtih my method call arguments. Is it possible to do some other, more nice way?

I will be glad for any help and suggestions.
Re: Interface & Session problem [message #650215 is a reply to message #650188] Sun, 23 January 2011 08:48 Go to previous messageGo to next message
Markus Kuppe is currently offline Markus KuppeFriend
Messages: 177
Registered: July 2009
Senior Member
On 01/22/2011 05:57 PM, kith1985@o2.pl wrote:
> Hello guys,
>
> Im quite new about ECF and there is not many docs about that and i
> runed into some problems. First problem is about interfaces. I have two
> interfaces A and B extends A. Now i register remote service which
> implements B. When i call remote methods from interface B everything
> works fine but when i call anything from A i got NoSuchMethod exception.
> Anybody knows what is the problem? I use 'generic server and generic
> client' containers.

What does the stacktrace look like? Which ECF version are you on?

> Second problem is harder (at least for me). I have server and client
> and i need client to login first to be able to use my service API. How i
> can make client identificable from server side when he call any remote
> methods? I dont wanna put any sessionId togather wtih my method call
> arguments. Is it possible to do some other, more nice way?
>
> I will be glad for any help and suggestions.

You might be interested in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332601

Markus
Re: Interface & Session problem [message #650218 is a reply to message #650215] Sun, 23 January 2011 09:52 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
Yes, that link is something i would need and looks very promising. About stcktrace it looks like this and its only some test example which i use for solve my problem. I use version 3.2:

osgi> org.osgi.framework.ServiceException: Service exception on remote service proxy rsid=org.eclipse.ecf.remoteservice.RemoteServiceID[container ID=StringID[ecftcp://localhost:2345/test];containerRelativeID=0]
at org.eclipse.ecf.provider.remoteservice.generic.RemoteService Impl.invoke(RemoteServiceImpl.java:131)
at $Proxy0.login(Unknown Source)
at autowire.RemoteServerListener.addingService(RemoteServerList ener.java:22)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAddin g(ServiceTracker.java:896)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTr acked.java:261)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked. java:233)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged( ServiceTracker.java:840)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceLis tener.serviceChanged(FilteredServiceListener.java:104)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.d ispatchEvent(BundleContextImpl.java:933)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEv entSynchronous(ListenerQueue.java:149)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.pu blishServiceEventPrivileged(ServiceRegistry.java:756)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.pu blishServiceEvent(ServiceRegistry.java:711)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistratio nImpl.register(ServiceRegistrationImpl.java:129)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.re gisterService(ServiceRegistry.java:206)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.r egisterService(BundleContextImpl.java:507)
at org.eclipse.ecf.internal.osgi.services.distribution.Discover edServiceTrackerImpl.registerRemoteServiceReferences(Discove redServiceTrackerImpl.java:548)
at org.eclipse.ecf.internal.osgi.services.distribution.Discover edServiceTrackerImpl.handleDiscoveredServiceAvailable(Discov eredServiceTrackerImpl.java:245)
at org.eclipse.ecf.internal.osgi.services.distribution.Discover edServiceTrackerImpl.access$3(DiscoveredServiceTrackerImpl.j ava:175)
at org.eclipse.ecf.internal.osgi.services.distribution.Discover edServiceTrackerImpl$1.run(DiscoveredServiceTrackerImpl.java :120)
at org.eclipse.equinox.concurrent.future.SingleOperationFuture$ 1.run(SingleOperationFuture.java:96)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.equinox.concurrent.future.SingleOperationFuture. runWithProgress(SingleOperationFuture.java:89)
at org.eclipse.equinox.concurrent.future.ThreadsExecutor$1.run( ThreadsExecutor.java:49)
at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.ecf.core.util.ECFException: Exception in remote call
at org.eclipse.ecf.provider.remoteservice.generic.RegistryShare dObject.callSynch(RegistrySharedObject.java:453)
at org.eclipse.ecf.provider.remoteservice.generic.RemoteService Impl.callSync(RemoteServiceImpl.java:64)
at org.eclipse.ecf.provider.remoteservice.generic.RemoteService Impl.invoke(RemoteServiceImpl.java:115)
... 24 more
Caused by: java.lang.NoSuchMethodException: login
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.doInvoke(S haredObjectMsg.java:313)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.invoke(Sha redObjectMsg.java:294)
at org.eclipse.ecf.provider.remoteservice.generic.RemoteService RegistrationImpl.callService(RemoteServiceRegistrationImpl.j ava:340)
at org.eclipse.ecf.provider.remoteservice.generic.RegistryShare dObject.handleCallRequest(RegistrySharedObject.java:861)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.doInvoke(S haredObjectMsg.java:324)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsg.invoke(Sha redObjectMsg.java:294)
at org.eclipse.ecf.provider.remoteservice.generic.RegistryShare dObject.handleSharedObjectMsg(RegistrySharedObject.java:1135 )
at org.eclipse.ecf.core.sharedobject.BaseSharedObject.handleSha redObjectMsgEvent(BaseSharedObject.java:453)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsgEventProces sor.processSharedObjectMsgEvent(SharedObjectMsgEventProcesso r.java:41)
at org.eclipse.ecf.core.sharedobject.SharedObjectMsgEventProces sor.processEvent(SharedObjectMsgEventProcessor.java:36)
at org.eclipse.ecf.core.sharedobject.BaseSharedObject.fireEvent Processors(BaseSharedObject.java:190)
at org.eclipse.ecf.core.sharedobject.BaseSharedObject.handleEve nt(BaseSharedObject.java:126)
at org.eclipse.ecf.provider.generic.SOWrapper.svc(SOWrapper.jav a:185)
at org.eclipse.ecf.provider.generic.SOWrapper$2.run(SOWrapper.j ava:138)
... 1 more

The whole situation looks like this again. I have intefrace A which have 'login' method, and interface B which extends A and add some more methods. Now i publish interface B and i call method 'login'. It throws exception like above. If i call method from B everything works fine. I can call method 'login' but only when i publish object under A interface. I dont understand why i cannot call 'login' method from 'B' interface?
Re: Interface & Session problem [message #650227 is a reply to message #650188] Sun, 23 January 2011 12:41 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
About interface problem ive downloaded source and i see its very strange for me. This is part of code responsible for that from file SharedObjectMsg.java :


public static Method findMethod(final Class clazz, String meth, Class args[]) {
try {
return ClassUtil.getDeclaredMethod(clazz, meth, args);
} catch (NoSuchMethodException e) {
return null;
}
}

It is called for search invoked method. As you see it gets only declared methods within Class. Thats why for my B interface methods from interface A are invisible. When ive changed to code like this:

public static Method findMethod(final Class clazz, String meth, Class args[]) {
try {
return ClassUtil.getDeclaredMethod(clazz, meth, args);
} catch (NoSuchMethodException e) {
try {
return ClassUtil.getMethod(clazz, meth, args);
} catch (NoSuchMethodException e1) {
return null;
}
}
}

it works fine. Anybody knows whats the reason they've made it such way? Or maybe its some bug?
Re: Interface & Session problem [message #650290 is a reply to message #650218] Mon, 24 January 2011 08:57 Go to previous messageGo to next message
Markus Kuppe is currently offline Markus KuppeFriend
Messages: 177
Registered: July 2009
Senior Member
On 01/23/2011 10:52 AM, kith1985@o2.pl wrote:
> Yes, that link is something i would need and looks very promising. About
> stcktrace it looks like this and its only some test example which i use
> for solve my problem. I use version 3.2:

ECF 3.2 is a rather old version. Thus try moving to ECF 3.4 [0] or even
HEAD [1]. We have made changes to the method lookup code since 3.2.

Btw. what's the login method's exact signature?

Markus

[0] http://eclipse.org/ecf/downloads.php
[1]
http://build.ecf-project.org/repo/N-HEAD-sdk.feature/lastSuc cessful/archive/site.p2/
Re: Interface & Session problem [message #650327 is a reply to message #650290] Mon, 24 January 2011 12:23 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
I moved already from 3.2 to 3.4 and the strange code i showed about is take exactly from 3.4 version. About method signature it really doesn't matter how look like cause i want call just method, lets say 'void test();' It doesn't work because of what i wrote above. The only question is why its done that way? Why they prevent me from calling that?
Re: Interface & Session problem [message #650474 is a reply to message #650327] Tue, 25 January 2011 07:46 Go to previous message
Markus Kuppe is currently offline Markus KuppeFriend
Messages: 177
Registered: July 2009
Senior Member
On 01/24/2011 01:23 PM, kith1985@o2.pl wrote:
> I moved already from 3.2 to 3.4 and the strange code i showed about is
> take exactly from 3.4 version. About method signature it really doesn't
> matter how look like cause i want call just method, lets say 'void
> test();' It doesn't work because of what i wrote above. The only
> question is why its done that way? Why they prevent me from calling that?

Hi,

please file a bug over at https://bugs.eclipse.org and attach a test
case or at least both interfaces causing this behavior.

Markus
Previous Topic:Problem with scribble share example
Next Topic:SSL protocol
Goto Forum:
  


Current Time: Wed Dec 04 19:19:18 GMT 2024

Powered by FUDForum. Page generated in 0.04750 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top