Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Problem regarding hello.ds examples.

 Hi Jeff,

On 9/7/2010 11:12 AM, Jeff Hamm wrote:
Hi Scott --

Here is the email thread that I found when researching this problem -

http://dev.eclipse.org/mhonarc/lists/ecf-dev/msg03505.html


The code is the same code as in the example hello.ds example for the client and the host.

Given that the exception/stack trace indicates something quite different, I don't think this mailing list post is the same issue. Actually, for this old issue, I now suspect that Ali's problem was due to not including the org.eclipse.ecf.provider.remoteservices bundle in his product specification. For the generic provider, this bundle (org.eclipse.ecf.provider.remoteservices) is needed to implement remote services.

Could there be a timing issue where the host has not been able to register before the client makes the request?

This doesn't seem likely to me...as if you are using DS on the consumer as well...it should wait until discovery takes place (which is triggered by the host registration).

But it doesn't appear to me that the exception you are reporting is due to a client request...it seems to be occurring because of the cast to IRemoteServiceProxy in the bindHello method on the host. At least that's what it seems to me.

Scott

Thanks --
Jeff

-----Original Message-----
From: ecf-dev-bounces@xxxxxxxxxxx [mailto:ecf-dev-bounces@xxxxxxxxxxx] On Behalf Of Scott Lewis
Sent: Tuesday, September 07, 2010 2:01 PM
To: ecf-dev@xxxxxxxxxxx
Subject: Re: [ecf-dev] Problem regarding hello.ds examples.

   Jeff,

On 9/7/2010 8:16 AM, Jeff Hamm wrote:
Hi,

I have been working with the ECF examples that use ds in order to grow out this functionality within our application.  I am running Eclipse 3.6 with the latest ECF framework plugins.

Essentially, I have the host.ds and the client.ds plugins enabled into our autostart bundle and launch them in conjunction with the other osgi bundles instead of the .product files they come with in the example.

The code has changed only to allow the host.ds to be activated via the activate and deactivate methods so that this service is available.

When I start the application, I see the following:

(TRACE)[09/07/10;10:50:42:482]TRACING
org.eclipse.ecf.internal.osgi.services.distribution.EventHookImpl#hand
leRegisteredServiceEvent(WARNING:No remote service containers found
for
serviceReference={org.eclipse.cosmos.me.sdd.runtime.internal.service.I
Hello}={component.name=org.eclipse.cosmos.me.sdd.runtime.service.host,
component.id=41,
org.eclipse.ecf.containerFactoryArgs=ecftcp://localhost:30001/server,
service.exported.configs=ecf.generic.server,
service.exported.interfaces=*, service.id=89}. Service NOT EXPORTED)
[log;-0400 2010.09.07
10:50:42:482;WARNING;org.eclipse.ecf.osgi.services.distribution;org.ec
lipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.distrib
ution;code=2;message=org.eclipse.ecf.internal.osgi.services.distributi
on.EventHookImpl:handleRegisteredServiceEvent:No remote service
containers found for
serviceReference={org.eclipse.cosmos.me.sdd.runtime.internal.service.I
Hello}={component.name=org.eclipse.cosmos.me.sdd.runtime.service.host,
component.id=41,
org.eclipse.ecf.containerFactoryArgs=ecftcp://localhost:30001/server,
service.exported.configs=ecf.generic.server,
service.exported.interfaces=*, service.id=89}. Service NOT
EXPORTED;severity2;exception=null;children=[]]]


And then subsequently, the client fails to start because it cannot
cast the IHello

Got proxy IHello=xxx.xxx.HelloComponent@4bd173
STARTING remote call via proxy...
received hello from=helloclientcomponent via proxy COMPLETED remote
call via proxy

ERROR 43 [SCR] Error while trying to bind reference Reference[name = IHello, interface = service.IHello, policy = dynamic, cardinality = 0..n, target = null, bind = bindHello, unbind = null]
          Details:
          Problematic reference = Reference[name = IHello, interface = service.IHello, policy = dynamic, cardinality = 0..n, target = null, bind = bindHello, unbind = null]
          of service component = service.advisor
          component implementation class = service.advisor.HelloClientComponent
          located in bundle with symbolic name = service.advisor
          bundle location =
reference:file:/U:/dev/test2/service.advisor/
java.lang.reflect.InvocationTargetException
          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.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:360)
          at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:424)
          at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:209)
          at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:327)
          at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:580)
          at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:196)
          at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:431)
          at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
          at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
          at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
          at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
          at
org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Exe
cutor.java:70) Caused by: java.lang.ClassCastException:
service.host.HelloComponent cannot be cast to org.eclipse.ecf.remoteservice.IRemoteServiceProxy
          at service.advisor.HelloClientComponent.bindHello(HelloClientComponent.java:80)
          ... 16 more

I saw on a different thread that this sort of error had been reported before but there was no resolution listed. Is this a known bug?

Not that I'm aware of, no.  This error doesn't resemble any existing thread that I'm aware of...if I missed some thread that does bear resemblance to this then please point it out to me.

  From the stack trace, this looks like some of your code is trying to cast the service.host.HelloComponent to
org.eclipse.ecf.remoteservice.IRemoteServiceProxy:

Caused by: java.lang.ClassCastException: service.host.HelloComponent cannot be cast to org.eclipse.ecf.remoteservice.IRemoteServiceProxy
          at service.advisor.HelloClientComponent.bindHello(HelloClientComponent.java:80)


This cast (i.e. from service.host.HelloComponent to
org.eclipse.ecf.remoteservice.IRemoteServiceProxy) definitely *should*
throw an exception on the host.   It is used internally to ECF remote
services on the consumer/client side (i.e. the proxy)...not the host.

Scott


_______________________________________________
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