Hi Scott,
sorry about the slow reply. :)
Of course you were right with the value for
service.exported.configs. After that the server started
successfully.
After fiddling around with some endpoint properties the client
could successfully connect to the server and the remote service
was imported and could be used.
One issue still exists. After client launch the following
exception happens (on client side):
RemoteReferenceNotFoundException[targetID=URIID
[uri=tcp://127.0.0.1:3000], idFilter=[URIID
[uri=tcp://127.0.0.1:3000]], interfaces=[service.IHello],
rsFilter=null]
at
org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.importService(RemoteServiceAdmin.java:2243)
at
org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin.importService(RemoteServiceAdmin.java:436)
at
service.consumer.ServiceImporter.importService(ServiceImporter.java:39)
at
service.consumer.ServiceImporter.activate(ServiceImporter.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:229)
at
org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
at
org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:650)
at
org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:506)
at
org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:307)
at
org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:299)
at
org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:298)
at
org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:109)
at
org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)
at
org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:749)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430)
at
org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657)
at
org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341)
at
org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390)
at
org.apache.felix.scr.impl.Activator.access$200(Activator.java:54)
at
org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265)
at
org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254)
at
org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227)
at
org.apache.felix.utils.extender.AbstractExtender.addingBundle(AbstractExtender.java:187)
at
org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)
at
org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at
org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
at
org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at
org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
at
org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
at
org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
at
org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
at
org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
at org.eclipse.osgi.container.Module.doStart(Module.java:578)
at org.eclipse.osgi.container.Module.start(Module.java:449)
at
org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634)
at
org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614)
at
org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585)
at
org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528)
at
org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
!ENTRY org.eclipse.ecf.osgi.services.remoteserviceadmin 4 0
2018-08-14 16:03:25.913
!MESSAGE
org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.remoteserviceadmin;code=4;message=org.eclipse.ecf.osgi.services.remoteserviceadmin.TopologyManagerImpl:handleRemoteAdminEvent.IMPORT_ERROR:Import
error with event=RemoteServiceAdminEvent[containerID=null,
getType()=5,
getSource()=org.eclipse.ecf.osgi.services.remoteserviceadmin_4.6.800.v20180518-0149
[21],
getException()=RemoteReferenceNotFoundException[targetID=URIID
[uri=tcp://127.0.0.1:3000], idFilter=[URIID
[uri=tcp://127.0.0.1:3000]], interfaces=[service.IHello],
rsFilter=null], getImportReference()=null,
getExportReference()=null];severity4;exception=null;children=[]]
ImportRegistration[importReference=ImportReference[importEndpoint=null;exception=RemoteReferenceNotFoundException[targetID=URIID
[uri=tcp://127.0.0.1:3000], idFilter=[URIID
[uri=tcp://127.0.0.1:3000]], interfaces=[service.IHello],
rsFilter=null]];closed=false]
Some seconds later however the service binding happens
nevertheless and the remote call is successful. Maybe a timing or
startup issue....
Till now I was not able to test this setup in our environment,
but from what I've seen it should work for us and solve the recent
issues regarding service matching with hostnames.
How do you see the project tcpsocket provider regarding further
development / maintenance?
Do you see the project as a proof of concept or do you think it
is useful enough for a broader user base and continue development?
What open points / issues do you see with the current code base?
What needs be be fixed / changed / added from your point of view?
Thanks for your information!
Bye Peter
Am 09.08.2018 um 01:26 schrieb Scott
Lewis:
Hi Peter
Sorry about the slow reply. I'm out on a gig.
I think the service.exported.configs prop value should be
ecf.socket.server
As per
https://github.com/ECF/tcpsocketdistributionprovider/blob/master/bundles/org.eclipse.ecf.provider.tcpsocket.common/src/org/eclipse/ecf/provider/tcpsocket/common/TCPSocketConstants.java
RE the genetic provider...it was done long before rsa...and there is the peer services also as discussed.
Hope this helps.
Scott
From: "Peter Hermsdorf" <peter.hermsdorf@xxxxxxxxx>
Date: Tue, Aug 7, 2018 7:07 am
To: ecf-dev@xxxxxxxxxxx
Subject: Re: [ecf-dev] Problem with Service Endpoint matching when using different network names
Hi Scott,
thanks again for providing this sample implementation! That makes it very transparent how things work.
Actually I thought the ecf-generic provider would work that way ;)
I wasn't able to get the server up and running. Maybe a problem with the launch configuration. See below for the bundles and their states.
I added a sample service which should by exported by adding something like
@Component(property = {
"service.exported.interfaces=*",
"service.exported.configs=ecf.namespace.socket"
})
public class HelloService implements IHello{
public HelloService() {
System.err.println();
}
@Override
public void sayHello() {
System.err.println("Hello");
}
}
but as said before, the server does not seem to get started. The start code in the Activator does the registration but the RemoteServiceContainerInstantiator.createInstance is never called.
Any idea?
Thanks!
Bye Peter
ss
id State Bundle
0 ACTIVE org.eclipse.osgi_3.12.50.v20170928-1321
Fragments=22
2 ACTIVE org.eclipse.equinox.common_3.9.0.v20170207-1454
5 ACTIVE org.eclipse.ecf.remoteservice.asyncproxy_2.1.0.v20180409-2248
6 ACTIVE javax.inject_1.0.0.v20091030
8 ACTIVE org.eclipse.equinox.event_1.4.0.v20170105-1446
9 ACTIVE javax.annotation_1.2.0.v201602091430
11 ACTIVE org.eclipse.osgi.util_3.4.0.v20170111-1608
14 ACTIVE com.ibm.icu_58.2.0.v20170418-1837
18 ACTIVE org.eclipse.equinox.concurrent_1.1.0.v20130327-1442
19 ACTIVE org.eclipse.osgi.services_3.6.0.v20170228-1906
22 RESOLVED org.eclipse.osgi.compatibility.state_1.1.0.v20170516-1513
Master=0
23 ACTIVE org.eclipse.equinox.preferences_3.7.0.v20170126-2132
25 ACTIVE org.apache.batik.css_1.8.0.v20170214-1941
26 ACTIVE org.eclipse.core.contenttype_3.6.0.v20170207-1037
27 ACTIVE org.eclipse.core.jobs_3.9.2.v20171030-1027
31 ACTIVE org.apache.felix.scr_2.0.10.v20170501-2007
33 ACTIVE org.eclipse.ecf.identity_3.9.0.v20180426-1936
34 ACTIVE org.eclipse.equinox.registry_3.7.0.v20170222-1344
41 ACTIVE org.w3c.css.sac_1.3.1.v200903091627
43 ACTIVE org.eclipse.ecf.provider.tcpsocket.common_1.0.0.qualifier
48 ACTIVE org.apache.commons.jxpath_1.3.0.v200911051830
50 ACTIVE org.eclipse.ecf_3.9.0.v20180402-2015
Fragments=52
51 ACTIVE org.apache.batik.util_1.8.0.v20170214-1941
52 RESOLVED org.eclipse.ecf.ssl_1.2.100.v20180301-0132
Master=50
58 ACTIVE org.eclipse.core.runtime_3.13.0.v20170207-1030
68 ACTIVE org.eclipse.ecf.provider.tcpsocket.server_1.0.0.qualifier
70 ACTIVE org.eclipse.ecf.remoteservice_8.13.0.v20180406-1915
73 ACTIVE org.eclipse.equinox.app_1.3.400.v20150715-1528
75 ACTIVE org.eclipse.ecf.provider.remoteservice_4.4.100.v20180516-2213
76 ACTIVE org.eclipse.ecf.provider_4.8.0.v20180402-2103
77 ACTIVE org.eclipse.ecf.sharedobject_2.6.0.v20180404-2345
78 ACTIVE org.apache.felix.gogo.runtime_0.10.0.v201209301036
79 ACTIVE org.apache.felix.gogo.shell_0.10.0.v201212101605
80 ACTIVE org.eclipse.equinox.console_1.1.300.v20170512-2111
81 ACTIVE service.api_1.0.0.qualifier
82 ACTIVE service.provider_1.0.0.qualifier
83 ACTIVE org.eclipse.ecf.discovery_5.0.300.v20180306-0211
84 ACTIVE org.eclipse.ecf.osgi.services.distribution_2.1.200.v20180301-0016
85 ACTIVE org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy_1.0.100.v20180301-0016
86 ACTIVE org.eclipse.ecf.osgi.services.remoteserviceadmin_4.6.800.v20180518-0149
87 ACTIVE org.eclipse.ecf.provider.jmdns_4.3.200.v20180306-0429
88 ACTIVE org.eclipse.osgi.services.remoteserviceadmin_1.6.200.v20180301-0016
89 ACTIVE org.eclipse.ecf.remoteservice.eventadmin_1.3.0.v20180426-2032
90 ACTIVE org.eclipse.ecf.server_2.1.200.v20180302-2006
91 ACTIVE org.eclipse.equinox.ds_1.5.0.v20170307-1429
Am 27.07.2018 um 20:08 schrieb Scott Lewis:
On 7/27/2018 7:22 AM, Peter Hermsdorf wrote:
Hi Scott,
that sounds and looks really promising! I'll need some time to process the information you gave and look at the code and then come back to you.
This morning I've added some code to allow properties to set the hostname and port on server side, and to use the ecf.endpoint.id on client side to connect to the given hostname and port. This is working...see TCPSocketServerContainer and TCPSocketClientContainer classes.
I've been testing localhost with the LAN-based discovery (zeroconf) so the hostname/port exported in the endpoint description is what is used on the client. If/when other discovery and import is used on the client, then it can do whatever it wants wrt what hostname and port to use to connect to the server.
There are some ways that this is limited, but it can be generalized or extended, and I'm hoping it will give a good idea of how to create others.
Scott