[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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#handleRegisteredServiceEvent(WARNING:No remote service containers found for serviceReference={org.eclipse.cosmos.me.sdd.runtime.internal.service.IHello}={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.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.distribution;code=2;message=org.eclipse.ecf.internal.osgi.services.distribution.EventHookImpl:handleRegisteredServiceEvent:No remote service containers found for serviceReference={org.eclipse.cosmos.me.sdd.runtime.internal.service.IHello}={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(Executor.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