Alexander Blotny wrote:
Hi,
I am trying to export a service via rmi and ws.
My config.xml looks that way:
<scact:sca-config targetNamespace="http://sample"
xmlns:scact="http://www.osgi.org/xmlns/scact/v1.0.0"
xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
<tuscany:binding.rmi name="AddressBook"
uri="rmi://localhost:8085/AddressBookService"/> <sca:binding.ws
name="AddressBook" uri="http://localhost:8086/AddressBookService"/>
</scact:sca-config>
And the component.xml:
<scr:component name="AddressBookComponent"
xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> <implementation
class="de.fhg.fokus.ngni.odysseus.service.addressbook.AddressBook" />
<service> <provide
interface="de.fhg.fokus.ngni.odysseus.service.addressbook.impl.AddressBookImpl"
/> </service> </scr:component>
According to the samples I have set the path to these files in the
Bundle-Manifest.
When I am starting the bundle the service is only exported as rmi. By
switching the declarations the service is exported as a web service.
It seems that the second binding is ignored. There is no error message.
Do I have to configure it another way?
I'm not familiar with the SCA support in OSGi, but I noticed two
things in these definitions that look strange to me.
Firstly, the two bindings have the same name "AddressBook". In SCA
it's illegal to have two bindings on a service which both have the
same name.
Secondly, the implementation class is given as AddressBook and the
interface is given as AddressBookImpl. I would have expected the
class to be AddressBookImpl and the interface to be AddressBook.
Simon
Additionally I have another question. I am wondering if it is possible
to change the export of a service on runtime (after the bundle was
started). Is it necessary to stop the bundle and change the xml file? If
not how can it dynamically be done?
Thanks,
Alex