Hi folks,
I’m trying to export and use multiple remote services from one
server machine, which currently does not seem to work.
On Client side I’m using multiple EDEF Bundles(generated) to
describe the services to discover. The xml is like this:
<?xml version="1.0" encoding="UTF-8"?>
<endpoint-descriptions
xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
<endpoint-description>
<property name="ecf.endpoint.id.ns" value-type="String"
value="org.eclipse.ecf.core.identity.StringID"/>
<property name="endpoint.id" value-type="String"
value="ecftcp://peter-desktop:8889/Server"/>
<property
name="endpoint.package.version.com.godyo.service1.api"
value-type="String" value="1.0.0"/>
<property name="endpoint.service.id" value-type="Long"
value="0"/>
<property name="objectClass" value-type="String">
<array>
<value>com.godyo.service1.api.IService1</value>
</array>
</property>
<property name="remote.configs.supported"
value-type="String">
<array>
<value>ecf.generic.server</value>
</array>
</property>
<property name="remote.intents.supported"
value-type="String">
<array>
<value>passByValue</value>
<value>exactlyOnce</value>
<value>ordered</value>
</array>
</property>
<property name="service.imported" value-type="String"
value="true"/>
<property name="service.imported.configs"
value-type="String">
<array>
<value>ecf.generic.server</value>
</array>
</property>
</endpoint-description>
</endpoint-descriptions>
The same for the second service with changed objectClass and
packagename.
On server side I'm exporting the Services using a DS secription like
this one:
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
enabled="true" immediate="true"
name="com.godyo.provider.service1">
<implementation class="com.godyo.Service1Impl"/>
<property name="service.exported.interfaces" type="String"
value="*"/>
<property name="service.exported.configs" type="String"
value="ecf.generic.server"/>
<property name="ecf.generic.server.port" type="String"
value="8889"/>
<service>
<provide interface="com.godyo.service1.api.IService1"/>
</service>
</scr:component>
the same for Service 2 with changed "name", "implementation class"
and "provided interface" of course.
On server startup i get the following message in the console:
!ENTRY org.eclipse.ecf.osgi.services.remoteserviceadmin 4 0
2015-03-10 16:15:01.161
!MESSAGE
org.eclipse.core.runtime.MultiStatus[plugin=org.eclipse.ecf.osgi.services.remoteserviceadmin;code=4;message=Advertise
endpointDesription=ECFEndpointDescription[id=ecftcp://peter-desktop:8889/server;endpoint.service.id=2;frameworkid=20cbb433-38c7-0014-1758-9d831483e3d2].
Problem in unadvertise;severity4;exception=null;children=[Status
ERROR: org.eclipse.ecf.osgi.services.remoteserviceadmin code=0
Advertise
endpointDescription=ECFEndpointDescription[id=ecftcp://peter-desktop:8889/server;endpoint.service.id=2;frameworkid=20cbb433-38c7-0014-1758-9d831483e3d2].
Service Info is null. Cannot publish
endpointDescription=ECFEndpointDescription[id=ecftcp://peter-desktop:8889/server;endpoint.service.id=2;frameworkid=20cbb433-38c7-0014-1758-9d831483e3d2]
null]]
When listing the "services" on the osgi server console i get:
{com.godyo.service1.api.IService1}={ecf.generic.server.port=8889,
component.name=com.godyo.provider.service1, component.id=0,
service.exported.configs=ecf.generic.server,
service.exported.interfaces=*, service.id=48}
Registered by bundle: com.godyo.p5.service1_4.1.1453.qualifier
[12]
Bundles using service:
org.eclipse.ecf.osgi.services.remoteserviceadmin_3.0.0.v20131027-1505
[29]
{com.godyo.service1.api.IService2}={ecf.generic.server.port=8889,
component.name=com.godyo.provider.service2, component.id=2,
service.exported.configs=ecf.generic.server,
service.exported.interfaces=*, service.id=66}
Registered by bundle: com.godyo.p5.service2_4.1.1453.qualifier
[24]
Bundles using service:
org.eclipse.ecf.osgi.services.remoteserviceadmin_3.0.0.v20131027-1505
[29]
On client side only one of the remote services gets registered (i
think the last one/2nd ....)
Should this setup work this way or is there another approach needed
to provide/consume multiple services?
I also tried using different values for
ecf.generic.server.path
(in the above axample "/server") for the two different
services on client and server but also with no luck ...
My environment:
- ECF version 3.7 (i'm currently bound to eclipse indigo 3.7 RCP)
- generic provider
Any hints on a solution are very welcome!
Thanks, bye peter
|