0

I am trying to get remote OSGi services working with my existing RCP application (Mars based). However it does not seem to be working - two instances of my application do not see the services published in the other one.

I have added the latest ECF SDK to my target platform and I have added the following bundles to my product runtime;

  • org.eclipse.ecf.discovery
  • org.eclipse.ecf.provider
  • org.eclipse.ecf.provider.remoteservice
  • org.eclipse.ecf.sharedobject
  • org.eclipse.equinox.concurrent
  • org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy
  • org.eclipse.osgi.services.remoteserviceadmin
  • org.eclipse.ecf.remoteservice.asyncproxy
  • org.eclipse.ecf.remoteservice
  • org.eclipse.ecf.osgi.services.distribution
  • org.eclipse.ecf.provider.jmdns
  • ch.ethz.iks.r_osgi.remote
  • org.eclipse.ecf.provider.r_osgi
  • org.eclipse.ecf.console
  • org.eclipse.ecf.provider.dnssd
  • org.xbill.dns
  • org.eclipse.ecf.provider.discovery

In one of my bundle activators, I have the following to register my service in the start method()

ServiceTracker _containerManagerServiceTracker = new ServiceTracker(_context, IContainerManager.class.getName(), null);
_containerManagerServiceTracker.open();

IContainerManager containerManager = (IContainerManager) _containerManagerServiceTracker.getService();

IContainer container = containerManager.getContainerFactory().createContainer("ecf.r_osgi.peer");


IMyService myService = new MyService();
Properties props = new Properties();
props.put(IDistributionConstants.SERVICE_EXPORTED_INTERFACES, IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD);
props.put(IDistributionConstants.SERVICE_EXPORTED_CONFIGS, "ecf.r_osgi.peer");
// register remote service
context.registerService(IMyService.class, myService, props);

I know something is working as the second instance reports;

"WARNING: Port 9278 already in use. This instance of R-OSGi is running on port 9279"

I also see one record appearing "_ECFOSGIRSVC" in a zeroconf browser.

The numerous tutorials seem to indicate that this service should magically become available on the other instance. However nothing appears (running "services" in the application console only lists the local services). Some questions;

  • Is this really all that is needed?
  • How do I debug this?
    • How do I know if the service is really exported?
    • How do I know if the other instance is really searching for it?
  • Is it possible to a) report out the container endpoint and "manually" connect with the other instance?

There are lots of "HelloService" tutorials with not quite the same content that make getting starting very confusing!

Simon
  • 720
  • 4
  • 12

1 Answers1

0

try Riena Communication its less complicated for publishing and binding remote services. It uses hessian as communication protocol. its really fast in comparison to soap and co., since its binary based protocol (not xml)

I hope this helps.

Community
  • 1
  • 1
Hisham Khalil
  • 1,054
  • 8
  • 9