Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Newbie problem/question

Hi Ali,

Ali Naddaf wrote:

Hello everyone.

I am trying to learn more about the ECF and started with a simple example where there is a simple "echo" service, published by ECF and a client to call that. I am using declarative services and am running in an issue with publishing my service; here is my component.xml for my service:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"; enable="true" immediate="true" name="ecf.test.one.host">
<implementation class="ecf.test.one.EchoServiceImp"/>
<property name="service.exported.interfaces" type="String" value="*"/>
<property name="service.exported.configs" type="String" value="ecf.generic.server"/> <property name="org.eclipse.ecf.containerFactoryArgs" type="String" value="ecftcp://localhost:3001/server"/>
<service>
<provide interface="ecf.test.one.echoservice.EchoService"/>
</service>
<reference cardinality="1..1" interface="org.eclipse.ecf.core.IContainerFactory" name="IContainerFactory" policy="static"/>
</scr:component>

and when I start the framework, I get the following exception:

osgi> [log;-0500 2010.04.18 22:34:10:972;INFO;org.eclipse.ecf.osgi.services.distribution;org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.distribution;code=0;message=Exception creating container from ContainerTypeDescription=ContainerTypeDescription[name=ecf.generic.server;instantiator=org.eclipse.ecf.provider.generic.GenericContainerInstantiator@1ab28fe;desc=ECF Generic Server;;severity4;exception=org.eclipse.core.runtime.AssertionFailedException: null argument:;children=[]]]
org.eclipse.core.runtime.AssertionFailedException: null argument:
    at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
    at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
at org.eclipse.ecf.remoteservice.RemoteServiceContainer.<init>(RemoteServiceContainer.java:29) at org.eclipse.ecf.remoteservice.RemoteServiceContainer.<init>(RemoteServiceContainer.java:38) at org.eclipse.ecf.osgi.services.distribution.AbstractHostContainerFinder.createMatchingContainer(AbstractHostContainerFinder.java:217) at org.eclipse.ecf.osgi.services.distribution.AbstractHostContainerFinder.createAndConfigureHostContainers(AbstractHostContainerFinder.java:194) at org.eclipse.ecf.osgi.services.distribution.DefaultHostContainerFinder.findHostContainers(DefaultHostContainerFinder.java:45) at org.eclipse.ecf.internal.osgi.services.distribution.EventHookImpl.findHostContainers(EventHookImpl.java:173) at org.eclipse.ecf.internal.osgi.services.distribution.EventHookImpl.handleRegisteredServiceEvent(EventHookImpl.java:97) at org.eclipse.ecf.internal.osgi.services.distribution.EventHookImpl.event(EventHookImpl.java:61) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyEventHooksPrivileged(ServiceRegistry.java:1143) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:743) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:711) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:206) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507) at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:488) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:205) at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:429) at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:211) at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:798) at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:765)
    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) [log;-0500 2010.04.18 22:34:10:974;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={ecf.test.one.echoservice.EchoService}={component.name=ecf.test.one.host, component.id=0, org.eclipse.ecf.containerFactoryArgs=ecftcp://localhost:3001/server, service.exported.configs=ecf.generic.server, service.exported.interfaces=*, service.id=47}. Service NOT EXPORTED;severity2;exception=null;children=[]]]


I can't figure out what I am missing. Any help is greatly appreciated to get me going.

Hmmm. This is a little puzzeling. The problem seems to be that in AbstractHostContainerFinder is this code (starting on line 215):

               IContainer container = createContainer(serviceReference,
                       containerTypeDescription);
               return new RemoteServiceContainer(container);

The call to new RemoteServiceContainer(container); is apparently throwing the AssertionFailedException/assertion error...as the value of container is apparently null. But I don't quite understand how createContainer could actually return null in your case.

In the example code (org.eclipse.ecf.examples.remoteservices.hello.ds.host), the ds markup is this...and it looks very close to yours:

<implementation class="org.eclipse.ecf.examples.internal.remoteservices.hello.ds.host.HelloComponent"/>
  <property name="service.exported.interfaces" type="String" value="*"/>
<property name="service.exported.configs" type="String" value="ecf.generic.server"/> <property name="org.eclipse.ecf.containerFactoryArgs" type="String" value="ecftcp://localhost:30001/server"/>
  <service>
<provide interface="org.eclipse.ecf.examples.remoteservices.hello.IHello"/>
  </service>
<reference cardinality="1..1" interface="org.eclipse.ecf.core.IContainerFactory" name="IContainerFactory" policy="static"/>

And this host starts up just fine.

Would you be willing to send me your test projects and let me run/debug using it? This seems to be something wrong/bug in the container finder implementation, but I can't immediately tell what it is.

If you are willing, please just export to zip your projects for the host (no need for the client at the moment), and I will take a look at what's going on.

Thanks,

Scott



Back to the top