Home » Archived » Eclipse Communications Framework (ECF) » Hello example over network(Unable to detect host/consumer over network)
Hello example over network [message #1235173] |
Thu, 23 January 2014 18:16 |
James Williams Messages: 27 Registered: July 2009 |
Junior Member |
|
|
Hi there,
I'm new to ECF, hoping to use it for our project, and am trying to get to grips with the examples. I'm following the 'hello' example: http://wiki.eclipse.org/EIG:Getting_Started_with_OSGi_Remote_Services and trying to run the (zeroconf/generic).products for the basic Hello Service Consumer and Hello Service Host.
Running both the host and consumer on the same machine works fine. If I try to run them on two separate machines (connected directly via an ethernet cable), they are unable to discover each other. Could this be an issue with the machines blocking the port? I'm running Mac OS X Mavericks on both.
I've attached logs from both machines - including the list of plugins running. One thing that I guess it might be related to is the message printed on the host:
Quote:
!ENTRY org.eclipse.ecf.osgi.services.remoteserviceadmin 4 0 2014-01-23 17:30:21.617
!MESSAGE org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.remoteserviceadmin;code=4;message=org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin:postEvent:No EventAdmin service available to send eventTopic=org/osgi/service/remoteserviceadmin/EXPORT_REGISTRATION eventProperties={endpoint.service.id=1, event=RemoteServiceAdminEvent[containerID=StringID[ecftcp://localhost:3787/server], getType()=2, getSource()=org.eclipse.ecf.osgi.services.remoteserviceadmin_3.0.0.v20131027-1505 [2], getException()=null, getImportReference()=null, getExportReference()=org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin$ExportReference@6b61be00], bundle.id=2, export.registration=ECFEndpointDescription[id=ecftcp://localhost:3787/server;endpoint.service.id=1;frameworkid=b0dc6905-5484-0013-104c-c952377792d4], objectClass=[Ljava.lang.String;@5e012913, endpoint.framework.uuid=b0dc6905-5484-0013-104c-c952377792d4, timestamp=1390498221613, endpoint.id=ecftcp://localhost:3787/server, service.imported.configs=[Ljava.lang.String;@1e2fce9c, bundle.symbolicname=org.eclipse.ecf.osgi.services.remoteserviceadmin, bundle=org.eclipse.ecf.osgi.services.remoteserviceadmin_3.0.0.v20131027-1505 [2], bundle.version=3.0.0.v20131027-1505, bundle.signer=[Ljava.lang.String;@54a5733f};severity4;exception=null;children=[]]
Host: Hello Service Registered
Furthermore, the (zeroconf,generic) products are the only ones I can get to talk to each other at all - none of the other products that ship with the examples detect each other locally or via the network. The (edef,generic) products simply don't do anything (host starts fine, consumer just loads osgi console). The (zookeeper, generic) products just load the osgi console. For the (*, r--osgi) products, the host doesn't run because I'm missing a package "org.objectweb.asm", and the consumer doesn't run because it doesn't recognise the container type "ecf.r_osgi.peer". I'm not too fussed about getting these working, as zeroconf is likely to be enough for me, however, I thought I should give you as much information as possible just in case it helps to solve the original problem.
I haven't changed any of the examples' code.
Many thanks,
Jim
|
|
|
Re: Hello example over network [message #1235212 is a reply to message #1235173] |
Thu, 23 January 2014 20:42 |
Scott Lewis Messages: 1038 Registered: July 2009 |
Senior Member |
|
|
Hi James,
Quote:Running both the host and consumer on the same machine works fine. If I try to run them on two separate machines (connected directly via an ethernet cable), they are unable to discover each other. Could this be an issue with the machines blocking the port? I'm running Mac OS X Mavericks on both.
It's possible that there is a port problem, but I *think* from your export registration info that the problem is that the default containerId is set to the default...i.e. localhost:
ecftcp://localhost:3787/server
This works fine when both the consumer and the host are running on 'localhost', but when the host is running on some other host, the client can't reach it at 'localhost'...even when/if discovered. So, first, this needs to be set to something like:
ecftcp://your.host.name.or.ip.address:3787/server
One of the program arguments in these *.product configurations is this one:
-containerId ecftcp://localhost:3787/server
If you change this to
-containerId ecftcp://your.host.name.or.ip.address:3787/server
Then it should allow the consumer/client to reach your host over a network (given that your.host.name.or.ip.address will be something that the consumer/client can reach).
Now...unfortunately it is also possible that the zeroconf discovery has been/is disabled on your LAN...and/or various ports could be restricted on your host and/or consumer machines (although it sounds as if zeroconf is working when both host and consumer are running on localhost).
There are configuration properties for the generic provider and r-osgi provider, a page with all of these specified is:
http://wiki.eclipse.org/EIG:Configuration_Properties
Zookeeper's specifically:
http://wiki.eclipse.org/Zoodiscovery#How_to_configure_ZooDiscovery_container.3F
WRT to the other discovery/distribution providers (e.g. zookeeper+generic, zookeeper+r-osgi, etc). I'm not sure why these aren't working for you. They are working for me/us when running on localhost, but it's possible there is some problem/interaction with version of Eclipse and/or something else. If you would, I would appreciate it if you would open a new bug (perhaps one specifically for r-osgi to start), and I/we will help diagnose on that bug. To open a bug, got to:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=ECF
and choose the ecf.providers component, and put [r-osgi] at the beginning of the subject. That way other ECF committers will be able to help diagnose and/or provide necessary info.
WRT the edef products...for the consumers it's necessary to explicitly start the edef bundle to get the discovery to occur. Although admittedly not ideal, there are some reasons for this extra step for the examples. Here's a page that documents how to do this:
http://wiki.eclipse.org/File-based_Discovery_with_the_Endpoint_Description_Extender_Format
See section 'Running EDEF Hello Example...' on the above page.
BTW, we understand that the selection of a discovery (and distribution) provider is somewhat complicated (e.g. zookeeper?, zeroconf, dnssd?, etc)...and we are doing some things now...with the OSGi RSA specification...to help with this. The usefulness of this flexibility, however, is pretty helpful, as we and others have found that it's common for remote service developers to change/use different discovery (and distribution) providers under different situations (e.g. for development vs. deployment)...without making fundamental changes to the remote service and/or consumers of that remote service.
It does have the negative side effect, however, that some examples can work in one network environment but not in others. We are trying to mitigate those negative side effects.
|
|
| |
Re: Hello example over network [message #1235259 is a reply to message #1235248] |
Thu, 23 January 2014 23:38 |
James Williams Messages: 27 Registered: July 2009 |
Junior Member |
|
|
Hi Scott,
Quick update: I found this page: http://www.eclipse.org/ecf/documentation.php#Container Connection and tried to connect to the server manually. I added the following lines in HelloConsumerApplication.java:start() just before the waitForDone() call:
IContainer cont = getContainerFactory().createContainer("ecf.generic.client");
cont.addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectingEvent) {
System.out.println("Connecting...");
} else if (event instanceof IContainerConnectedEvent) {
System.out.println("Connected!");
} else {
System.out.println("Event: " + event);
}
}
});
// make targetID
ID targetID = IDFactory.getDefault().createID(cont.getConnectNamespace(),"ecftcp://169.254.188.136:3787/server");
// then connect to targetID with null authentication data
cont.connect(targetID,null);
System.out.println("Connected to: "+cont.getConnectedID());
Which resulted in the following output:
Quote:
osgi> Hello Consumer Application
Connecting...
Connected!
Connected to: StringID[ecftcp://169.254.188.136:3787/server]
So I'm able to directly connect, but the ServiceTracker doesn't find it... Instead of using the createRemoteFilter() call to produce a Filter to pass to the ServiceTracker constructor, I've tried the alternate: helloServiceTracker = new ServiceTracker(bundleContext, IHello.class, this); which also doesn't do anything.
Will keep trying.
-J
[Updated on: Thu, 23 January 2014 23:58] Report message to a moderator
|
|
| | |
|
|
Goto Forum:
Current Time: Sat Oct 05 04:28:45 GMT 2024
Powered by FUDForum. Page generated in 0.04689 seconds
|