Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » ECF problem
icon3.gif  ECF problem [message #530051] Wed, 28 April 2010 10:42 Go to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
Hello guys,

Since few days im trying to solve my problem and i have no idea why it doesnt work. First of all i want run examples from ECF SDK but changed a little my own way. Ive created two plugins for host and for consumer and copied most of code inside. But my plugins doesnt extend IApplication, just typical plugin extending BundleActivator. My host should register IHello and consumer use it. From what i see service is registerd and in console i got message (source code):

Publish: {org.eclipse.ecf.osgi.services.discovery.ServicePublication} ={osgi.remote.discovery.publication.service.properties={}, ecf.rsvc.ns=ecf.namespace.generic.remoteservice, osgi.remote.service.interfaces=[example.host.IHello], ecf.rsvc.id=[48], ecf.sp.ect=[ecf.generic.server], ecf.sp.cid=StringID[ecftcp://localhost:12345/server], service.id=54} ServiceInfo: ServiceInfo[uri=osgiservices://10.36.7.148:12345 ;id=ServiceID[type=ServiceTypeID[typeName=_osgiservices._tcp .default._iana];location=osgiservices://10.36.7.148:12345;full= _osgiservices._tcp.default._iana@osgiservices://10.36.7.148: 12345 ];priority=0;weight=0;props=ServiceProperties[{ecf.rsvc.ns=e cf.namespace.generic.remoteservice, osgi.remote.service.interfaces=example.host.IHello, ecf.sp.cns=org.eclipse.ecf.core.identity.StringID, ecf.rsvc.id=org.eclipse.ecf.discovery.ServiceProperties$ByteArrayWrapper@18a8ce2, ecf.sp.ect=ecf.generic.server, ecf.sp.cid=org.eclipse.ecf.discovery.ServiceProperties$ByteArrayWrapper@12789d2}]]
hostRegistered
serviceReference={example.host.IHello}={org.eclipse.ecf.cont ainerFactoryArgs=ecftcp://localhost:12345/server, service.exported.configs=ecf.generic.server, service.exported.interfaces=*, service.id=53}
remoteServiceContainer=RemoteServiceContainer [containerID=StringID[ecftcp://localhost:12345/server], container=org.eclipse.ecf.provider.generic.TCPServerSOContainer@3257b8, containerAdapter= org.eclipse.ecf.provider.remoteservice.generic.RegistryShare dObject @1343ed0]
remoteRegistration=RemoteServiceRegistrationImpl[remoteServi ceID=org.eclipse.ecf.remoteservice.RemoteServiceID[container ID=StringID[ecftcp://localhost:12345/server];containerRelativeID=0];containerID=StringID[ecftcp://localhost:12345/server ];serviceid=0;serviceranking=0;classes=[example.host.IHello] ;state=0;properties={ecf.rsvc.id=0}]
Host: Hello Service Registered


I guess everything is fine on host side but nothing happens on client side. I got only:

Start consumer
Finish activator


No service is discovered. Why? What is wrong? I will be gratefull for help and ideas.

Maybe it will be useful if i give you also bundles list installed with consumer:

id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
1 ACTIVE org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
Fragments=33
4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
6 ACTIVE com.springsource.net.sf.cglib_2.1.3
7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
9 ACTIVE org.springframework.context_2.5.6.SEC01
10 ACTIVE org.springframework.beans_2.5.6.SEC01
11 ACTIVE org.springframework.osgi.core_1.2.1
12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
14 RESOLVED com.springsource.slf4j.log4j_1.5.0
Master=20
15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
16 ACTIVE org.springframework.osgi.mock_1.2.1
17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
19 ACTIVE org.springframework.aop_2.5.6.SEC01
20 ACTIVE com.springsource.slf4j.api_1.5.0
Fragments=14
21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
22 ACTIVE com.springsource.junit_3.8.2
23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
24 ACTIVE com.springsource.slf4j.org.apache.commons.logging_1.5.0
25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
26 ACTIVE org.springframework.core_2.5.6.SEC01
27 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
28 ACTIVE com.springsource.org.aopalliance_1.0.0
29 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
30 ACTIVE com.springsource.edu.emory.mathcs.backport_3.1.0
31 ACTIVE org.springframework.osgi.extender_1.2.1
32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
Master=3
34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
35 ACTIVE com.springsource.org.objectweb.asm_2.2.3
36 ACTIVE org.springframework.osgi.io_1.2.1
37 ACTIVE org.springframework.test_2.5.6.SEC01
38 ACTIVE org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
41 RESOLVED org.springframework.osgi.test_1.2.1
43 ACTIVE example.consumer_1.0.0.qualifier
44 RESOLVED example.host_1.0.0.qualifier
45 ACTIVE org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253



Part of host Source:

private static final String DEFAULT_CONTAINER_TYPE = "ecf.generic.server";
public static final String DEFAULT_CONTAINER_ID = "ecftcp://localhost:12345/server";

private BundleContext bundleContext;

private String containerType = DEFAULT_CONTAINER_TYPE;
private String containerId = DEFAULT_CONTAINER_ID;

private final Object appLock = new Object();
private boolean done = false;

private ServiceRegistration helloRegistration;
/*
* (non-Javadoc)
*
* @see
* org.osgi.framework.BundleActivator#start(org.osgi.framework. BundleContext
* )
*/

public void registered(ServiceReference serviceReference,
IRemoteServiceContainer remoteServiceContainer, IRemoteServiceRegistration remoteRegistration) {
System.out.println("hostRegistered\n\tserviceReference="+serviceReference+ "\n\tremoteServiceContainer="+remoteServiceContainer+"\n\tremoteRegistration= "+remoteRegistration);
}

public void unregistered(ServiceReference serviceReference, IRemoteServiceRegistration remoteRegistration) {
System.out.println("hostUnregistered\n\tserviceReference="+serviceReference+ "\n\tremoteRegistration="+remoteRegistration);
}

public void publish(ServiceReference arg0, IServiceInfo arg1){
System.out.println("Publish: "+arg0+" ServiceInfo: "+arg1);
}

public void unpublish(ServiceReference arg0, IServiceInfo arg1){
System.out.println("Unpublish: "+arg0+" ServiceInfo: "+arg1);
}

public void start(BundleContext ctxt) throws Exception {
context = ctxt;

//ContainerFactory.getDefault().createContainer("ecf.generic.server ");

Properties props = new Properties();
// add OSGi service property indicated export of all interfaces exposed by service (wildcard)
props.put(IDistributionConstants.SERVICE_EXPORTED_INTERFACES , IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD) ;
// add OSGi service property specifying config
props.put(IDistributionConstants.SERVICE_EXPORTED_CONFIGS, containerType);
// add ECF service property specifying container factory args
props.put(IDistributionConstants.SERVICE_EXPORTED_CONTAINER_ FACTORY_ARGUMENTS, containerId);
// register remote service

context.registerService(IHostDistributionListener.class.getN ame(),this,null);
context.registerService(IHostDiscoveryListener.class.getName (),this,null);

helloRegistration = context.registerService(IHello.class.getName(), new Hello(), props);
// tell everyone
System.out.println("Host: Hello Service Registered");
}


Part of consumer code:

public static final String CONSUMER_NAME = "example.consumer";

private BundleContext bundleContext;
private ServiceTracker containerFactoryServiceTracker;

private String containerType = "ecf.generic.client";

private final Object appLock = new Object();
private boolean done = false;

private ServiceTracker helloServiceTracker;


public void discovered(IServiceInfo arg0){
System.out.println("Service discovery: "+arg0);
}


public void undiscovered(IServiceInfo arg0){
System.out.println("Service discovery: "+arg0);

}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework. BundleContext)
*/
public void start(BundleContext context) throws Exception {
System.out.println("Start consumer");

bundleContext = context;

IContainerFactory cf = getContainerFactory();

IContainer container = cf.createContainer(containerType);
ID targetID = IDFactory.getDefault().createStringID("ecftcp://localhost:12345/server");
container.connect(targetID, null);

bundleContext.registerService(IProxyDiscoveryListener.class. getName(),this,null);
bundleContext.registerService(IProxyDistributionListener.cla ss.getName(),this,null);

// Create service tracker to track IHello instances that have the 'service.imported'
// property set (as defined by OSGi 4.2 remote services spec).
helloServiceTracker = new ServiceTracker(bundleContext, createRemoteFilter(), this);
helloServiceTracker.open();

startLocalDiscoveryIfPresent();

System.out.println("Finish activator");
}

private void startLocalDiscoveryIfPresent() {
Bundle[] bundles = bundleContext.getBundles();
for(int i=0; i < bundles.length; i++) {
if (bundles[i].getSymbolicName().equals("org.eclipse.ecf.osgi.services.discovery.local ")) {
try {
bundles[i].start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Re: ECF problem [message #530100 is a reply to message #530051] Wed, 28 April 2010 13:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: news.eclipse.org.08.lemmster.de

On 04/28/2010 12:43 PM, kith1985@o2.pl wrote:

> No service is discovered. Why? What is wrong? I will be gratefull for
> help and ideas.
>
> Maybe it will be useful if i give you also bundles list installed with
> consumer:
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
> 1 ACTIVE
> org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
> 2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
> 3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
> Fragments=33
> 4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
> 6 ACTIVE com.springsource.net.sf.cglib_2.1.3
> 7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
> 8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
> 9 ACTIVE org.springframework.context_2.5.6.SEC01
> 10 ACTIVE org.springframework.beans_2.5.6.SEC01
> 11 ACTIVE org.springframework.osgi.core_1.2.1
> 12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
> 13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
> 14 RESOLVED com.springsource.slf4j.log4j_1.5.0
> Master=20
> 15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
> 16 ACTIVE org.springframework.osgi.mock_1.2.1
> 17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
> 19 ACTIVE org.springframework.aop_2.5.6.SEC01
> 20 ACTIVE com.springsource.slf4j.api_1.5.0
> Fragments=14
> 21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
> 22 ACTIVE com.springsource.junit_3.8.2
> 23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
> 24 ACTIVE com.springsource.slf4j.org.apache.commons.logging_1.5.0
> 25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
> 26 ACTIVE org.springframework.core_2.5.6.SEC01
> 27 ACTIVE
> org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
> 28 ACTIVE com.springsource.org.aopalliance_1.0.0
> 29 ACTIVE
> org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
> 30 ACTIVE com.springsource.edu.emory.mathcs.backport_3.1.0
> 31 ACTIVE org.springframework.osgi.extender_1.2.1
> 32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
> 33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
> Master=3
> 34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
> 35 ACTIVE com.springsource.org.objectweb.asm_2.2.3
> 36 ACTIVE org.springframework.osgi.io_1.2.1
> 37 ACTIVE org.springframework.test_2.5.6.SEC01
> 38 ACTIVE org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
> 39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
> 40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
> 41 RESOLVED org.springframework.osgi.test_1.2.1
> 43 ACTIVE example.consumer_1.0.0.qualifier
> 44 RESOLVED example.host_1.0.0.qualifier
> 45 ACTIVE
> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253

Hi,

do you also have the org.eclipse.ecf.provider.jmdns deployed and active
on the host side?

Markus
Re: ECF problem [message #530105 is a reply to message #530051] Wed, 28 April 2010 13:41 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
Yes, i have got - ID 21 in the list.
Re: ECF problem [message #530122 is a reply to message #530105] Wed, 28 April 2010 14:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: news.eclipse.org.08.lemmster.de

On 04/28/2010 03:41 PM, kith1985@o2.pl wrote:
> Yes, i have got - ID 21 in the list.

You wrote that the bundle list originates from the client/consumer side.
In essence though, you have to make sure that the same discovery
provider (jmdns in your case) is deployed and active on both sides (host
and consumer). Also both sides have to be on the same subnet, as at
least jmdns, zookeeper as well as slp are all limited to multicast
discovery.

Markus
Re: ECF problem [message #530138 is a reply to message #530051] Wed, 28 April 2010 15:45 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi,

One way to get an idea of the necessary bundles for using various
discovery providers is to look at the list of bundles in the product
configurations for the hello example host and consumer.

i.e. in the consumer and host projects there is a products directory
with several product configurations:

<project root>/products/*.product

Inside these product configurations is a list of bundles/plugins...this
includes the necessary bundles for using the various discovery approaches.

Scott



kith1985@o2.pl wrote:
> Hello guys,
>
> Since few days im trying to solve my problem and i have no idea why it
> doesnt work. First of all i want run examples from ECF SDK but changed a
> little my own way. Ive created two plugins for host and for consumer and
> copied most of code inside. But my plugins doesnt extend IApplication,
> just typical plugin extending BundleActivator. My host should register
> IHello and consumer use it. From what i see service is registerd and in
> console i got message (source code):
>
> Publish: {org.eclipse.ecf.osgi.services.discovery.ServicePublication}
> ={osgi.remote.discovery.publication.service.properties={},
> ecf.rsvc.ns=ecf.namespace.generic.remoteservice,
> osgi.remote.service.interfaces=[example.host.IHello], ecf.rsvc.id=[48],
> ecf.sp.ect=[ecf.generic.server],
> ecf.sp.cid=StringID[ecftcp://localhost:12345/server], service.id=54}
> ServiceInfo: ServiceInfo[uri=osgiservices://10.36.7.148:12345
> ;id=ServiceID[type=ServiceTypeID[typeName=_osgiservices._tcp
> .default._iana];location=osgiservices://10.36.7.148:12345;full= _osgiservices._tcp.default._iana@osgiservices://10.36.7.148: 12345
> ];priority=0;weight=0;props=ServiceProperties[{ecf.rsvc.ns=e
> cf.namespace.generic.remoteservice,
> osgi.remote.service.interfaces=example.host.IHello,
> ecf.sp.cns=org.eclipse.ecf.core.identity.StringID,
> ecf.rsvc.id=org.eclipse.ecf.discovery.ServiceProperties$mail to:ByteArrayWrapper@18a8ce2,
> ecf.sp.ect=ecf.generic.server,
> ecf.sp.cid=org.eclipse.ecf.discovery.ServiceProperties$mailt o:ByteArrayWrapper@12789d2}]]
>
> hostRegistered
> serviceReference={example.host.IHello}={org.eclipse.ecf.cont
> ainerFactoryArgs=ecftcp://localhost:12345/server,
> service.exported.configs=ecf.generic.server,
> service.exported.interfaces=*, service.id=53}
> remoteServiceContainer=RemoteServiceContainer
> [containerID=StringID[ecftcp://localhost:12345/server],
> container=mailto:org.eclipse.ecf.provider.generic.TCPServerSOContainer@3257b8,
> containerAdapter=mailto: org.eclipse.ecf.provider.remoteservice.generic.RegistryShare dObject @1343ed0]
>
> remoteRegistration=RemoteServiceRegistrationImpl[remoteServi
> ceID=org.eclipse.ecf.remoteservice.RemoteServiceID[container
> ID=StringID[ecftcp://localhost:12345/server];containerRelativeID=0];containerID=StringID[ecftcp://localhost:12345/server
> ];serviceid=0;serviceranking=0;classes=[example.host.IHello]
> ;state=0;properties={ecf.rsvc.id=0}]
> Host: Hello Service Registered
>
> I guess everything is fine on host side but nothing happens on client
> side. I got only:
>
> Start consumer
> Finish activator
>
> No service is discovered. Why? What is wrong? I will be gratefull for
> help and ideas.
>
> Maybe it will be useful if i give you also bundles list installed with
> consumer:
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
> 1 ACTIVE
> org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
> 2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
> 3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
> Fragments=33
> 4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
> 6 ACTIVE com.springsource.net.sf.cglib_2.1.3
> 7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
> 8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
> 9 ACTIVE org.springframework.context_2.5.6.SEC01
> 10 ACTIVE org.springframework.beans_2.5.6.SEC01
> 11 ACTIVE org.springframework.osgi.core_1.2.1
> 12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
> 13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
> 14 RESOLVED com.springsource.slf4j.log4j_1.5.0
> Master=20
> 15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
> 16 ACTIVE org.springframework.osgi.mock_1.2.1
> 17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
> 19 ACTIVE org.springframework.aop_2.5.6.SEC01
> 20 ACTIVE com.springsource.slf4j.api_1.5.0
> Fragments=14
> 21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
> 22 ACTIVE com.springsource.junit_3.8.2
> 23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
> 24 ACTIVE com.springsource.slf4j.org.apache.commons.logging_1.5.0
> 25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
> 26 ACTIVE org.springframework.core_2.5.6.SEC01
> 27 ACTIVE
> org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
> 28 ACTIVE com.springsource.org.aopalliance_1.0.0
> 29 ACTIVE
> org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
> 30 ACTIVE com.springsource.edu.emory.mathcs.backport_3.1.0
> 31 ACTIVE org.springframework.osgi.extender_1.2.1
> 32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
> 33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
> Master=3
> 34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
> 35 ACTIVE com.springsource.org.objectweb.asm_2.2.3
> 36 ACTIVE org.springframework.osgi.io_1.2.1
> 37 ACTIVE org.springframework.test_2.5.6.SEC01
> 38 ACTIVE org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
> 39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
> 40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
> 41 RESOLVED org.springframework.osgi.test_1.2.1
> 43 ACTIVE example.consumer_1.0.0.qualifier
> 44 RESOLVED example.host_1.0.0.qualifier
> 45 ACTIVE
> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
>
>
>
> Part of host Source:
>
> private static final String DEFAULT_CONTAINER_TYPE =
> "ecf.generic.server";
> public static final String DEFAULT_CONTAINER_ID =
> "ecftcp://localhost:12345/server";
>
> private BundleContext bundleContext;
>
> private String containerType = DEFAULT_CONTAINER_TYPE;
> private String containerId = DEFAULT_CONTAINER_ID;
>
> private final Object appLock = new Object();
> private boolean done = false;
>
> private ServiceRegistration helloRegistration;
> /*
> * (non-Javadoc)
> * * @see
> * org.osgi.framework.BundleActivator#start(org.osgi.framework.
> BundleContext
> * )
> */
>
> public void registered(ServiceReference serviceReference,
> IRemoteServiceContainer remoteServiceContainer,
> IRemoteServiceRegistration remoteRegistration) {
>
> System.out.println("hostRegistered\n\tserviceReference="+serviceReference+
> "\n\tremoteServiceContainer="+remoteServiceContainer+"\n\tremoteRegistration=
> "+remoteRegistration);
> }
> public void unregistered(ServiceReference serviceReference,
> IRemoteServiceRegistration remoteRegistration) {
>
> System.out.println("hostUnregistered\n\tserviceReference="+serviceReference+
> "\n\tremoteRegistration="+remoteRegistration);
> }
> public void publish(ServiceReference arg0, IServiceInfo arg1){
> System.out.println("Publish: "+arg0+" ServiceInfo: "+arg1);
> }
> public void unpublish(ServiceReference arg0, IServiceInfo
> arg1){
> System.out.println("Unpublish: "+arg0+" ServiceInfo: "+arg1);
> }
>
> public void start(BundleContext ctxt) throws Exception {
> context = ctxt;
>
>
> //ContainerFactory.getDefault().createContainer("ecf.generic.server ");
>
> Properties props = new Properties();
> // add OSGi service property indicated export of all interfaces
> exposed by service (wildcard)
> props.put(IDistributionConstants.SERVICE_EXPORTED_INTERFACES ,
> IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD) ;
> // add OSGi service property specifying config
> props.put(IDistributionConstants.SERVICE_EXPORTED_CONFIGS,
> containerType);
> // add ECF service property specifying container factory args
> props.put(IDistributionConstants.SERVICE_EXPORTED_CONTAINER_
> FACTORY_ARGUMENTS, containerId);
> // register remote service
>
> context.registerService(IHostDistributionListener.class.getN
> ame(),this,null);
> context.registerService(IHostDiscoveryListener.class.getName
> (),this,null);
>
> helloRegistration =
> context.registerService(IHello.class.getName(), new Hello(), props);
> // tell everyone
> System.out.println("Host: Hello Service Registered");
> }
>
>
> Part of consumer code:
>
> public static final String CONSUMER_NAME = "example.consumer";
>
> private BundleContext bundleContext;
> private ServiceTracker containerFactoryServiceTracker;
>
> private String containerType = "ecf.generic.client";
>
> private final Object appLock = new Object();
> private boolean done = false;
>
> private ServiceTracker helloServiceTracker;
>
>
> public void discovered(IServiceInfo arg0){
> System.out.println("Service discovery: "+arg0);
> }
>
> public void undiscovered(IServiceInfo arg0){
> System.out.println("Service discovery: "+arg0);
> }
> /*
> * (non-Javadoc)
> * @see
> org.osgi.framework.BundleActivator#start(org.osgi.framework. BundleContext)
> */
> public void start(BundleContext context) throws Exception {
> System.out.println("Start consumer");
>
> bundleContext = context;
>
> IContainerFactory cf = getContainerFactory();
>
> IContainer container = cf.createContainer(containerType);
> ID targetID =
> IDFactory.getDefault().createStringID("ecftcp://localhost:12345/server");
> container.connect(targetID, null);
>
> bundleContext.registerService(IProxyDiscoveryListener.class.
> getName(),this,null);
> bundleContext.registerService(IProxyDistributionListener.cla
> ss.getName(),this,null);
>
> // Create service tracker to track IHello instances that have
> the 'service.imported'
> // property set (as defined by OSGi 4.2 remote services spec).
> helloServiceTracker = new ServiceTracker(bundleContext,
> createRemoteFilter(), this);
> helloServiceTracker.open();
>
> startLocalDiscoveryIfPresent();
>
> System.out.println("Finish activator");
> }
>
> private void startLocalDiscoveryIfPresent() {
> Bundle[] bundles = bundleContext.getBundles();
> for(int i=0; i < bundles.length; i++) {
> if
> (bundles[i].getSymbolicName().equals("org.eclipse.ecf.osgi.services.discovery.local
> ")) {
> try {
> bundles[i].start();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> }
Re: ECF problem [message #530186 is a reply to message #530051] Wed, 28 April 2010 18:41 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
First - my run configuration is the same on host and consumer
Second - all bundles are active and no errors during start.
Third - i try it worked on localhost as you see so there is no case of different subnet or network problem
Forth - list of bundles which i installed are taken from ECF website and also ive verified it with taget configuration from SDK example

Since now nothing helps. I tried many ways but nothing happens and i have completly no idea how to make it works.
Re: ECF problem [message #530243 is a reply to message #530186] Thu, 29 April 2010 03:34 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
It seems to me it's likely that the network discovery protocol that you
are using is not working properly on your network. What discovery
bundles are you using/including in your run configuration? Would you
post the set of bundles in your run configuration (since it's same for
host/consumer)?...perhaps we can help diagnose given that.

Unfortunately, there are a number of reasons why a given network won't
handle a given network discovery protocol (for example: variations in
router configurations). I can assure you, though, that with networks
that support, say, zeroconf...and with the set of bundles as specified
in the example product configurations...the network discovery does occur
properly.

So if you would list the bundles that you are including (and perhaps
even the output of the status/ss console command when running) we'll try
to help diagnose and fix this further.

Another option, btw, is to use static, xml-file-based discovery rather
than any kind of network discovery. There is a provider and an example
xml file for doing this in the hello.consumer project...along with a
product configuration that includes the appropriate set of bundles to
start the consumer and have it use file-based discovery (the xml file
specifies localhost as the target...but this can be changed to match the
desired host).

Scott


kith1985@o2.pl wrote:
> First - my run configuration is the same on host and consumer
> Second - all bundles are active and no errors during start.
> Third - i try it worked on localhost as you see so there is no case of
> different subnet or network problem
> Forth - list of bundles which i installed are taken from ECF website and
> also ive verified it with taget configuration from SDK example
>
> Since now nothing helps. I tried many ways but nothing happens and i
> have completly no idea how to make it works.
Re: ECF problem [message #530272 is a reply to message #530243] Thu, 29 April 2010 07:42 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
I put already bundles list but i can give you again. Its the same on host and consumer:

id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
1 ACTIVE org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
Fragments=33
4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
27 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
29 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
Master=3
34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
43 ACTIVE example.consumer_1.0.0.qualifier
44 RESOLVED example.host_1.0.0.qualifier
45 ACTIVE org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
46 ACTIVE org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253

It cannot be any network problem couse like i said its on localhost, nowhere else.
Re: ECF problem [message #530388 is a reply to message #530272] Thu, 29 April 2010 14:25 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi kith1985,

Thanks for the list...I will look it over and compare it to the list
that works properly.

One immediate question: I presume you are *not* using declarative
services (ds) in your example app (i.e. expecting to use it for
injection), as I do not see ds in the list of bundles below.

This brings up another question: how is your code being notified of the
discovery? If not via ds...is it using a ServiceTracker?

See a few more comments/questions below.

kith1985@o2.pl wrote:
> I put already bundles list but i can give you again. Its the same on
> host and consumer:
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
> 1 ACTIVE
> org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
> 2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
> 3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
> Fragments=33
> 4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
> 7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
> 8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
> 12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
> 13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
> 15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
> 17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
> 21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
> 23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
> 25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
> 27 ACTIVE
> org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
> 29 ACTIVE
> org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
> 32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
> 33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
> Master=3
> 34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
> 39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
> 40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
> 43 ACTIVE example.consumer_1.0.0.qualifier
> 44 RESOLVED example.host_1.0.0.qualifier
> 45 ACTIVE
> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
> 46 ACTIVE
> org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
> 47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
> 48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253
>
> It cannot be any network problem couse like i said its on localhost,
> nowhere else.


Unfortunately, with zeroconf and other multi-cast based protocols even
if on localhost it can still be a problem with the network.

Also...have you tried the local/file-based discovery? I see that those
bundles are in your set above. Theres some documentation on this here

http://wiki.eclipse.org/File-based_Discovery

and there is an example in the hello world consumer project in
OSGI-INF/remote-service


Scott
Re: ECF problem [message #530393 is a reply to message #530388] Thu, 29 April 2010 14:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: news.eclipse.org.08.lemmster.de

On 04/29/2010 04:25 PM, Scott Lewis wrote:

> Unfortunately, with zeroconf and other multi-cast based protocols even
> if on localhost it can still be a problem with the network.

Think desktop firewall, multicast traffic not send through lo...

Markus
Re: ECF problem [message #530858 is a reply to message #530388] Sat, 01 May 2010 22:39 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi kith1985,

Here's the information I've gathered so far.

For the hello host, I started from the following product configuration:

/org.eclipse.ecf.examples.remoteservices.hello.host/products /Hello
Service Host (generic).product

See below for output.

Then, I started the hello consumer, using the following product
configuration:

/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product

Below the console output, I've given the contents of the Hello Service
Host (generic).product configuration and the Hello Service Consumer
(generic, zeroconf discovery).product configuration.

What happened

The hello remote service was published via zeroconf discovery provider,
and successfully discovered by the consumer on my network (i.e. the
zeroconf-based discovery worked and the consumer invoked the remote
service successfully). I did an console short status on the host before
starting the consumer, and on the consumer I set a break point in the
ServiceTracker.addingService method, and did an console short status
there before allowing the consumer to continue (and make the actual
remote call on the discovered proxy).

Your list of bundles looks fairly comparable to mine (for the host).
There are a couple of differences...but they don't immediately jump out
as important to me. e.g I have
org.eclipse.core.runtime.compatibility.registry and you do not, but I
don't *think* that's necessary. Further, I have javax.servlet, but
again I don't think that's necessary.

You have these, and I do not

>> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
>> 46 ACTIVE
>> org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
>> 47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
>> 48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253

these are local discovery and ecf generic server support, neither of
which are not used by this example (at least if you are depending upon
zeroconf)

You don't seem to have an application that's actually started, however.
Is there an IApplication that you are starting? If *not*, how is
your service getting registered? I see that your example_host bundle is
resolved but not started...i.e.

>> 44 RESOLVED example.host_1.0.0.qualifier

But where in your code is the remote service registered? (i.e.
bundleContext.registerService?)

Also...how are you starting your bundles? It is possible that your
registerService is occuring *before* the
org.eclipse.ecf.osgi.services.distribution bundles is started...and that
can/could be a problem, as the distribution bundle must be started so
that the service registry hook can be installed...before the
registerService (the service registry hook is how ECF intercepts OSGi
service registry uses like registerService).

Some other questions: How is your consumer setup? Is a service tracker
created/setup in somewhere? (in the bundle activator?).

Did you try using the local discovery for the consumer? (i.e. including
in your consumer bundles a remote-services.xml file with the service
description for the service host)...see in the
org.eclipse.ecf.examples.remoteservices.hello.consumer project for example).

Also, would it be possible for you to provide me with your host and
consumer code? If so, I will try to run it in my network
environment...and if it works for me then it will give more evidence to
the theory that there is something preventing the zeroconf discovery
from working as it does on my local network.

Thanks,

Scott


---- Console output of Host from product configuration:
/org.eclipse.ecf.examples.remoteservices.hello.host/products /Hello
Service Host (generic).product

osgi> Host: Hello Service Registered


osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
3 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
10 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
11 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=20
12 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
15 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
16 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
18 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
20 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=11
30 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=67
38 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
51 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
55 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.host_2.0.0.qua lifier
56 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
58 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
59 RESOLVED javax.servlet_2.5.0.v200910301333
60 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
61 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
62 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
63 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
64 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
65 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
66 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
67 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=30
68 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
3 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
10 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
11 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=20
12 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
15 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
16 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
18 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
20 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=11
30 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=67
38 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
51 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
55 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.host_2.0.0.qua lifier
56 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
58 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
59 RESOLVED javax.servlet_2.5.0.v200910301333
60 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
61 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
62 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
63 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
64 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
65 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
66 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
67 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=30
68 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi> received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer via proxy
received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with listener
received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with future
received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer future


osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
3 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
10 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
11 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=20
12 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
15 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
16 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
18 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
20 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=11
30 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=67
38 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
51 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
55 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.host_2.0.0.qua lifier
56 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
58 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
59 RESOLVED javax.servlet_2.5.0.v200910301333
60 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
61 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
62 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
63 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
64 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
65 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
66 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
67 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=30
68 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi>


------------------------------------------------------------ -----
Output from run of Hello Example Consumer using product config:

/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product

osgi> IHello service proxy being added


osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
4 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
7 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
8 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
12 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
16 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
18 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=19
19 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=18
20 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=38
22 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
23 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
24 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
27 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
28 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.consumer_2.0.0 .qualifier
29 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
30 RESOLVED javax.servlet_2.5.0.v200910301333
31 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
32 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
33 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
34 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
35 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
36 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
37 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
38 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=20
39 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi> STARTING remote call via proxy...
COMPLETED remote call via proxy

STARTING async remote call via callback...
LOCAL async invocation complete

STARTING async remote call via future...
COMPLETED remote call with callback SUCCESS with result=Server says 'Hi'
back to org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with listener

LOCAL async future invocation complete

LOCAL future not yet done...so we're doing other stuff while waiting for
future to be done
COMPLETED remote call with future SUCCEEDED with result=Server says 'Hi'
back to org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with future

STARTING async remote call via future...
LOCAL async future invocation complete
LOCAL future not yet done...so we're doing other stuff while waiting for
future to be done
COMPLETED remote call with future SUCCEEDED with result=Server says 'Hi'
back to org.eclipse.ecf.examples.remoteservices.hello.consumer future



osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
4 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
7 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
8 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
12 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
16 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
18 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=19
19 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=18
20 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=38
22 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
23 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
24 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
27 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
28 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.consumer_2.0.0 .qualifier
29 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
30 RESOLVED javax.servlet_2.5.0.v200910301333
31 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
32 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
33 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
34 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
35 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
36 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
37 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
38 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=20
39 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi>


------------------------------------------------------------ ------
Hello Host product configuration...i.e. contents of file:
/org.eclipse.ecf.examples.remoteservices.hello.host/products /Hello
Service Host (generic).product

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="Generic Hello Host"
uid="org.eclipse.ecf.examples.remoteservices.generichellohost "
application=" org.eclipse.ecf.examples.remoteservices.hello.host.HelloHost "
version="1.0.0" useFeatures="false" includeLaunchers="false">

<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-containerType ecf.generic.server
-containerId ecftcp://localhost:3787/server
-console
-consoleLog</programArgs>
<vmArgsMac>-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>

<launcher>
<solaris/>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
<plugin id="javax.servlet"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry"
fragment="true"/>
<plugin id="org.eclipse.ecf"/>
<plugin id="org.eclipse.ecf.discovery"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello.host"/>
<plugin id="org.eclipse.ecf.identity"/>
<plugin id="org.eclipse.ecf.osgi.services.discovery"/>
<plugin id="org.eclipse.ecf.osgi.services.distribution"/>
<plugin id="org.eclipse.ecf.provider"/>
<plugin id="org.eclipse.ecf.provider.jmdns"/>
<plugin id="org.eclipse.ecf.provider.remoteservice"/>
<plugin id="org.eclipse.ecf.remoteservice"/>
<plugin id="org.eclipse.ecf.sharedobject"/>
<plugin id="org.eclipse.ecf.ssl" fragment="true"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.concurrent"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.services"/>
</plugins>

<configurations>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello.host"
autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true"
startLevel="2" />
<plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
</configurations>

</product>

------------------------------------------------------------ -------------
Contents of Hello Consumer product configuration...i.e.
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="Generic Hello Consumer"
uid=" org.eclipse.ecf.examples.remoteservices.generichelloconsumer "
application=" org.eclipse.ecf.examples.remoteservices.hello.consumer.Hello Consumer "
version="1.0.0" useFeatures="false" includeLaunchers="false">

<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-console -consoleLog -containerType
ecf.generic.client</programArgs>
<vmArgsMac>-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>

<launcher>
<solaris/>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
<plugin id="javax.servlet"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry"
fragment="true"/>
<plugin id="org.eclipse.ecf"/>
<plugin id="org.eclipse.ecf.discovery"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello.consumer"/ >
<plugin id="org.eclipse.ecf.identity"/>
<plugin id="org.eclipse.ecf.osgi.services.discovery"/>
<plugin id="org.eclipse.ecf.osgi.services.distribution"/>
<plugin id="org.eclipse.ecf.provider"/>
<plugin id="org.eclipse.ecf.provider.jmdns"/>
<plugin id="org.eclipse.ecf.provider.remoteservice"/>
<plugin id="org.eclipse.ecf.remoteservice"/>
<plugin id="org.eclipse.ecf.sharedobject"/>
<plugin id="org.eclipse.ecf.ssl" fragment="true"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.concurrent"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.services"/>
</plugins>


</product>

Scott Lewis wrote:
> Hi kith1985,
>
> Thanks for the list...I will look it over and compare it to the list
> that works properly.
>
> One immediate question: I presume you are *not* using declarative
> services (ds) in your example app (i.e. expecting to use it for
> injection), as I do not see ds in the list of bundles below.
>
> This brings up another question: how is your code being notified of the
> discovery? If not via ds...is it using a ServiceTracker?
>
> See a few more comments/questions below.
>
> kith1985@o2.pl wrote:
>> I put already bundles list but i can give you again. Its the same on
>> host and consumer:
>>
>> id State Bundle
>> 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
>> 1 ACTIVE
>> org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
>> 2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
>> 3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
>> Fragments=33
>> 4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
>> 7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
>> 8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
>> 12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
>> 13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
>> 15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
>> 17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
>> 21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
>> 23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
>> 25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
>> 27 ACTIVE
>> org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
>> 29 ACTIVE
>> org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
>> 32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
>> 33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
>> Master=3
>> 34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
>> 39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
>> 40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
>> 43 ACTIVE example.consumer_1.0.0.qualifier
>> 44 RESOLVED example.host_1.0.0.qualifier
>> 45 ACTIVE
>> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
>> 46 ACTIVE
>> org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
>> 47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
>> 48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253
>>
>> It cannot be any network problem couse like i said its on localhost,
>> nowhere else.
>
>
> Unfortunately, with zeroconf and other multi-cast based protocols even
> if on localhost it can still be a problem with the network.
>
> Also...have you tried the local/file-based discovery? I see that those
> bundles are in your set above. Theres some documentation on this here
>
> http://wiki.eclipse.org/File-based_Discovery
>
> and there is an example in the hello world consumer project in
> OSGI-INF/remote-service
>
>
> Scott
Re: ECF problem [message #625219 is a reply to message #530186] Thu, 29 April 2010 03:34 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
It seems to me it's likely that the network discovery protocol that you
are using is not working properly on your network. What discovery
bundles are you using/including in your run configuration? Would you
post the set of bundles in your run configuration (since it's same for
host/consumer)?...perhaps we can help diagnose given that.

Unfortunately, there are a number of reasons why a given network won't
handle a given network discovery protocol (for example: variations in
router configurations). I can assure you, though, that with networks
that support, say, zeroconf...and with the set of bundles as specified
in the example product configurations...the network discovery does occur
properly.

So if you would list the bundles that you are including (and perhaps
even the output of the status/ss console command when running) we'll try
to help diagnose and fix this further.

Another option, btw, is to use static, xml-file-based discovery rather
than any kind of network discovery. There is a provider and an example
xml file for doing this in the hello.consumer project...along with a
product configuration that includes the appropriate set of bundles to
start the consumer and have it use file-based discovery (the xml file
specifies localhost as the target...but this can be changed to match the
desired host).

Scott


kith1985@o2.pl wrote:
> First - my run configuration is the same on host and consumer
> Second - all bundles are active and no errors during start.
> Third - i try it worked on localhost as you see so there is no case of
> different subnet or network problem
> Forth - list of bundles which i installed are taken from ECF website and
> also ive verified it with taget configuration from SDK example
>
> Since now nothing helps. I tried many ways but nothing happens and i
> have completly no idea how to make it works.
Re: ECF problem [message #625243 is a reply to message #530243] Thu, 29 April 2010 07:42 Go to previous message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
I put already bundles list but i can give you again. Its the same on host and consumer:

id State Bundle
0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
1 ACTIVE org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
Fragments=33
4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
27 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
29 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
Master=3
34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
43 ACTIVE example.consumer_1.0.0.qualifier
44 RESOLVED example.host_1.0.0.qualifier
45 ACTIVE org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
46 ACTIVE org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253

It cannot be any network problem couse like i said its on localhost, nowhere else.
Re: ECF problem [message #625245 is a reply to message #625243] Thu, 29 April 2010 14:25 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi kith1985,

Thanks for the list...I will look it over and compare it to the list
that works properly.

One immediate question: I presume you are *not* using declarative
services (ds) in your example app (i.e. expecting to use it for
injection), as I do not see ds in the list of bundles below.

This brings up another question: how is your code being notified of the
discovery? If not via ds...is it using a ServiceTracker?

See a few more comments/questions below.

kith1985@o2.pl wrote:
> I put already bundles list but i can give you again. Its the same on
> host and consumer:
>
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
> 1 ACTIVE
> org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
> 2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
> 3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
> Fragments=33
> 4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
> 7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
> 8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
> 12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
> 13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
> 15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
> 17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
> 21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
> 23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
> 25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
> 27 ACTIVE
> org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
> 29 ACTIVE
> org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
> 32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
> 33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
> Master=3
> 34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
> 39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
> 40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
> 43 ACTIVE example.consumer_1.0.0.qualifier
> 44 RESOLVED example.host_1.0.0.qualifier
> 45 ACTIVE
> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
> 46 ACTIVE
> org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
> 47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
> 48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253
>
> It cannot be any network problem couse like i said its on localhost,
> nowhere else.


Unfortunately, with zeroconf and other multi-cast based protocols even
if on localhost it can still be a problem with the network.

Also...have you tried the local/file-based discovery? I see that those
bundles are in your set above. Theres some documentation on this here

http://wiki.eclipse.org/File-based_Discovery

and there is an example in the hello world consumer project in
OSGI-INF/remote-service


Scott
Re: ECF problem [message #625246 is a reply to message #530388] Thu, 29 April 2010 14:49 Go to previous message
Eclipse UserFriend
Originally posted by: news.eclipse.org.08.lemmster.de

On 04/29/2010 04:25 PM, Scott Lewis wrote:

> Unfortunately, with zeroconf and other multi-cast based protocols even
> if on localhost it can still be a problem with the network.

Think desktop firewall, multicast traffic not send through lo...

Markus
Re: ECF problem [message #625250 is a reply to message #530388] Sat, 01 May 2010 22:39 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi kith1985,

Here's the information I've gathered so far.

For the hello host, I started from the following product configuration:

/org.eclipse.ecf.examples.remoteservices.hello.host/products /Hello
Service Host (generic).product

See below for output.

Then, I started the hello consumer, using the following product
configuration:

/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product

Below the console output, I've given the contents of the Hello Service
Host (generic).product configuration and the Hello Service Consumer
(generic, zeroconf discovery).product configuration.

What happened

The hello remote service was published via zeroconf discovery provider,
and successfully discovered by the consumer on my network (i.e. the
zeroconf-based discovery worked and the consumer invoked the remote
service successfully). I did an console short status on the host before
starting the consumer, and on the consumer I set a break point in the
ServiceTracker.addingService method, and did an console short status
there before allowing the consumer to continue (and make the actual
remote call on the discovered proxy).

Your list of bundles looks fairly comparable to mine (for the host).
There are a couple of differences...but they don't immediately jump out
as important to me. e.g I have
org.eclipse.core.runtime.compatibility.registry and you do not, but I
don't *think* that's necessary. Further, I have javax.servlet, but
again I don't think that's necessary.

You have these, and I do not

>> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
>> 46 ACTIVE
>> org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
>> 47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
>> 48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253

these are local discovery and ecf generic server support, neither of
which are not used by this example (at least if you are depending upon
zeroconf)

You don't seem to have an application that's actually started, however.
Is there an IApplication that you are starting? If *not*, how is
your service getting registered? I see that your example_host bundle is
resolved but not started...i.e.

>> 44 RESOLVED example.host_1.0.0.qualifier

But where in your code is the remote service registered? (i.e.
bundleContext.registerService?)

Also...how are you starting your bundles? It is possible that your
registerService is occuring *before* the
org.eclipse.ecf.osgi.services.distribution bundles is started...and that
can/could be a problem, as the distribution bundle must be started so
that the service registry hook can be installed...before the
registerService (the service registry hook is how ECF intercepts OSGi
service registry uses like registerService).

Some other questions: How is your consumer setup? Is a service tracker
created/setup in somewhere? (in the bundle activator?).

Did you try using the local discovery for the consumer? (i.e. including
in your consumer bundles a remote-services.xml file with the service
description for the service host)...see in the
org.eclipse.ecf.examples.remoteservices.hello.consumer project for example).

Also, would it be possible for you to provide me with your host and
consumer code? If so, I will try to run it in my network
environment...and if it works for me then it will give more evidence to
the theory that there is something preventing the zeroconf discovery
from working as it does on my local network.

Thanks,

Scott


---- Console output of Host from product configuration:
/org.eclipse.ecf.examples.remoteservices.hello.host/products /Hello
Service Host (generic).product

osgi> Host: Hello Service Registered


osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
3 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
10 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
11 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=20
12 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
15 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
16 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
18 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
20 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=11
30 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=67
38 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
51 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
55 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.host_2.0.0.qua lifier
56 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
58 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
59 RESOLVED javax.servlet_2.5.0.v200910301333
60 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
61 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
62 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
63 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
64 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
65 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
66 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
67 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=30
68 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
3 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
10 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
11 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=20
12 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
15 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
16 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
18 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
20 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=11
30 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=67
38 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
51 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
55 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.host_2.0.0.qua lifier
56 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
58 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
59 RESOLVED javax.servlet_2.5.0.v200910301333
60 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
61 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
62 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
63 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
64 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
65 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
66 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
67 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=30
68 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi> received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer via proxy
received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with listener
received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with future
received hello
from=org.eclipse.ecf.examples.remoteservices.hello.consumer future


osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
3 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
10 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
11 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=20
12 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
15 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
16 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
18 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
20 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=11
30 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=67
38 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
51 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
55 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.host_2.0.0.qua lifier
56 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
58 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
59 RESOLVED javax.servlet_2.5.0.v200910301333
60 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
61 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
62 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
63 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
64 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
65 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
66 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
67 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=30
68 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi>


------------------------------------------------------------ -----
Output from run of Hello Example Consumer using product config:

/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product

osgi> IHello service proxy being added


osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
4 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
7 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
8 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
12 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
16 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
18 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=19
19 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=18
20 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=38
22 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
23 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
24 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
27 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
28 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.consumer_2.0.0 .qualifier
29 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
30 RESOLVED javax.servlet_2.5.0.v200910301333
31 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
32 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
33 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
34 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
35 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
36 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
37 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
38 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=20
39 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi> STARTING remote call via proxy...
COMPLETED remote call via proxy

STARTING async remote call via callback...
LOCAL async invocation complete

STARTING async remote call via future...
COMPLETED remote call with callback SUCCESS with result=Server says 'Hi'
back to org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with listener

LOCAL async future invocation complete

LOCAL future not yet done...so we're doing other stuff while waiting for
future to be done
COMPLETED remote call with future SUCCEEDED with result=Server says 'Hi'
back to org.eclipse.ecf.examples.remoteservices.hello.consumer via async
proxy with future

STARTING async remote call via future...
LOCAL async future invocation complete
LOCAL future not yet done...so we're doing other stuff while waiting for
future to be done
COMPLETED remote call with future SUCCEEDED with result=Server says 'Hi'
back to org.eclipse.ecf.examples.remoteservices.hello.consumer future



osgi> ss

Framework is launched.

id State Bundle
0 ACTIVE org.eclipse.osgi_3.6.0.v20100422-1745
4 ACTIVE org.eclipse.ecf.identity_3.1.0.qualifier
7 ACTIVE org.eclipse.ecf.osgi.services.discovery_1.1.0.qualifier
8 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.qualifier
12 ACTIVE org.eclipse.ecf.provider_3.0.0.qualifier
16 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.qualifier
18 RESOLVED org.eclipse.ecf.ssl_1.0.0.qualifier
Master=19
19 ACTIVE org.eclipse.ecf_3.1.0.qualifier
Fragments=18
20 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.3.0.v20091 116
Master=38
22 ACTIVE org.eclipse.ecf.osgi.services.distribution_1.2.0.qualifier
23 ACTIVE org.eclipse.ecf.provider.remoteservice_3.3.0.qualifier
24 ACTIVE org.eclipse.ecf.discovery_3.0.0.qualifier
27 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_2.0.0.qualifie r
28 ACTIVE
org.eclipse.ecf.examples.remoteservices.hello.consumer_2.0.0 .qualifier
29 ACTIVE org.eclipse.ecf.remoteservice_4.1.0.qualifier
30 RESOLVED javax.servlet_2.5.0.v200910301333
31 RESOLVED org.eclipse.osgi.services_3.2.100.v20100108
32 <<LAZY>> org.eclipse.core.contenttype_3.4.100.v20100412
33 ACTIVE org.eclipse.equinox.common_3.6.0.v20100315
34 ACTIVE org.eclipse.core.runtime_3.6.0.v20100412
35 ACTIVE org.eclipse.core.jobs_3.5.0.v20100412
36 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100307
37 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100215
38 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100301
Fragments=20
39 ACTIVE org.eclipse.equinox.app_1.3.0.v20100304

osgi>


------------------------------------------------------------ ------
Hello Host product configuration...i.e. contents of file:
/org.eclipse.ecf.examples.remoteservices.hello.host/products /Hello
Service Host (generic).product

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="Generic Hello Host"
uid="org.eclipse.ecf.examples.remoteservices.generichellohost "
application=" org.eclipse.ecf.examples.remoteservices.hello.host.HelloHost "
version="1.0.0" useFeatures="false" includeLaunchers="false">

<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-containerType ecf.generic.server
-containerId ecftcp://localhost:3787/server
-console
-consoleLog</programArgs>
<vmArgsMac>-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>

<launcher>
<solaris/>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
<plugin id="javax.servlet"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry"
fragment="true"/>
<plugin id="org.eclipse.ecf"/>
<plugin id="org.eclipse.ecf.discovery"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello.host"/>
<plugin id="org.eclipse.ecf.identity"/>
<plugin id="org.eclipse.ecf.osgi.services.discovery"/>
<plugin id="org.eclipse.ecf.osgi.services.distribution"/>
<plugin id="org.eclipse.ecf.provider"/>
<plugin id="org.eclipse.ecf.provider.jmdns"/>
<plugin id="org.eclipse.ecf.provider.remoteservice"/>
<plugin id="org.eclipse.ecf.remoteservice"/>
<plugin id="org.eclipse.ecf.sharedobject"/>
<plugin id="org.eclipse.ecf.ssl" fragment="true"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.concurrent"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.services"/>
</plugins>

<configurations>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello.host"
autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true"
startLevel="2" />
<plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
</configurations>

</product>

------------------------------------------------------------ -------------
Contents of Hello Consumer product configuration...i.e.
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="Generic Hello Consumer"
uid=" org.eclipse.ecf.examples.remoteservices.generichelloconsumer "
application=" org.eclipse.ecf.examples.remoteservices.hello.consumer.Hello Consumer "
version="1.0.0" useFeatures="false" includeLaunchers="false">

<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-console -consoleLog -containerType
ecf.generic.client</programArgs>
<vmArgsMac>-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>

<launcher>
<solaris/>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
<plugin id="javax.servlet"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry"
fragment="true"/>
<plugin id="org.eclipse.ecf"/>
<plugin id="org.eclipse.ecf.discovery"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello"/>
<plugin id="org.eclipse.ecf.examples.remoteservices.hello.consumer"/ >
<plugin id="org.eclipse.ecf.identity"/>
<plugin id="org.eclipse.ecf.osgi.services.discovery"/>
<plugin id="org.eclipse.ecf.osgi.services.distribution"/>
<plugin id="org.eclipse.ecf.provider"/>
<plugin id="org.eclipse.ecf.provider.jmdns"/>
<plugin id="org.eclipse.ecf.provider.remoteservice"/>
<plugin id="org.eclipse.ecf.remoteservice"/>
<plugin id="org.eclipse.ecf.sharedobject"/>
<plugin id="org.eclipse.ecf.ssl" fragment="true"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.concurrent"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.services"/>
</plugins>


</product>

Scott Lewis wrote:
> Hi kith1985,
>
> Thanks for the list...I will look it over and compare it to the list
> that works properly.
>
> One immediate question: I presume you are *not* using declarative
> services (ds) in your example app (i.e. expecting to use it for
> injection), as I do not see ds in the list of bundles below.
>
> This brings up another question: how is your code being notified of the
> discovery? If not via ds...is it using a ServiceTracker?
>
> See a few more comments/questions below.
>
> kith1985@o2.pl wrote:
>> I put already bundles list but i can give you again. Its the same on
>> host and consumer:
>>
>> id State Bundle
>> 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
>> 1 ACTIVE
>> org.eclipse.ecf.provider.remoteservice_3.2.0.v20100219-1253
>> 2 ACTIVE org.eclipse.equinox.registry_3.4.100.v20090520-1800
>> 3 ACTIVE org.eclipse.ecf_3.1.0.v20100219-1253
>> Fragments=33
>> 4 ACTIVE org.eclipse.ecf.sharedobject_2.1.0.v20100219-1253
>> 7 ACTIVE org.eclipse.ecf.discovery_3.0.0.v20100219-1253
>> 8 ACTIVE org.eclipse.ecf.provider_3.0.0.v20100219-1253
>> 12 ACTIVE org.eclipse.ecf.identity_3.1.0.v20100219-1253
>> 13 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
>> 15 ACTIVE org.eclipse.equinox.app_1.2.1.R35x_v20091203
>> 17 ACTIVE org.eclipse.ecf.remoteservice_4.0.0.v20100219-1253
>> 21 ACTIVE org.eclipse.ecf.provider.jmdns_4.0.0.v20100219-1253
>> 23 ACTIVE org.eclipse.equinox.preferences_3.2.301.R35x_v20091117
>> 25 ACTIVE org.eclipse.core.runtime_3.5.0.v20090525
>> 27 ACTIVE
>> org.eclipse.ecf.osgi.services.distribution_1.1.0.v20100219-1 253
>> 29 ACTIVE
>> org.eclipse.ecf.osgi.services.discovery_1.1.0.v20100219-1253
>> 32 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800
>> 33 RESOLVED org.eclipse.ecf.ssl_1.0.0.v20100219-1253
>> Master=3
>> 34 ACTIVE org.eclipse.core.jobs_3.4.100.v20090429-1800
>> 39 ACTIVE org.eclipse.core.contenttype_3.4.1.R35x_v20090826-0451
>> 40 ACTIVE org.eclipse.equinox.concurrent_1.0.1.R35x_v20100209
>> 43 ACTIVE example.consumer_1.0.0.qualifier
>> 44 RESOLVED example.host_1.0.0.qualifier
>> 45 ACTIVE
>> org.eclipse.ecf.osgi.services.discovery.local_1.0.0.v2010021 9-1253
>> 46 ACTIVE
>> org.eclipse.ecf.provider.localdiscovery_1.0.0.v20100219-1253
>> 47 ACTIVE org.eclipse.ecf.server_2.0.0.v20100219-1253
>> 48 ACTIVE org.eclipse.ecf.server.generic_3.0.0.v20100219-1253
>>
>> It cannot be any network problem couse like i said its on localhost,
>> nowhere else.
>
>
> Unfortunately, with zeroconf and other multi-cast based protocols even
> if on localhost it can still be a problem with the network.
>
> Also...have you tried the local/file-based discovery? I see that those
> bundles are in your set above. Theres some documentation on this here
>
> http://wiki.eclipse.org/File-based_Discovery
>
> and there is an example in the hello world consumer project in
> OSGI-INF/remote-service
>
>
> Scott
Previous Topic:Using a jdbc database as backend storage
Next Topic:Graphical editors and ECF
Goto Forum:
  


Current Time: Tue Apr 16 10:05:43 GMT 2024

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

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

Back to the top