Millies, Sebastian wrote:
I have created TUSCANY-3683 and submitted a patch for DefaultRMIHost.java.
-- Sebastian

Thanks very much!  I have committed this patch and it will be
included in 1.6.1.

  Simon

-----Original Message-----
From: Simon Nash [mailto:[email protected]]
Sent: Wednesday, September 22, 2010 12:21 AM
To: [email protected]
Subject: Re: FW: FW: RMI cannot be promoted

Millies, Sebastian wrote:
the error occurs when the composite with the promoted binding
is activated in isolation, independent of whether it is used
as a component implementation.

The service name that is registered twice in the rmiregistry
is the serviceName attribute of the binding.rmi element, in
this case "LogAdapterServiceRMI".

Using the service name as the rmiregistry name isn't a very good idea.
It won't work if two different components happen to have RMI services
with the same name.

One way to work around the error would be to provide an explicit
RMI binding for the promoted service using a new RMI-name, e. g.:

 <service name="SLF4JLogAdapterService"
promote="SLF4JAdapterComponent/LogAdapterService">
        <ts:binding.rmi host="localhost" port="1099"
serviceName="PromotedLogAdapterServiceRMI"/>
  </service>

But this seems somewhat counterintuitive - if no binding is specified
for a
promoted service, the binding for the component service should simply
be taken from the original service definition. So I would still
classify Tuscany's
behaviour as a minor bug.

I agree.  Would you like to raise a JIRA and perhaps submit a fix?

   Simon

-- Sebastian

-----Original Message-----
From: Simon Laws [mailto:[email protected]]
Sent: Tuesday, September 21, 2010 11:24 AM
To: [email protected]
Subject: Re: FW: RMI cannot be promoted

On Mon, Sep 20, 2010 at 3:16 PM, Millies, Sebastian
<[email protected]> wrote:
by the way, the obvious thing (it seems to me) would be to use
Naming.rebind() instead of Naming.bind(). Is there a particular
reason why Naming.bind() is used? -- Sebastian


-----Original Message-----
From: Millies, Sebastian [mailto:[email protected]]
Sent: Monday, September 20, 2010 1:10 PM
To: [email protected]
Subject: Bug: RMI cannot be promoted

Hello there,

is this a known bug in Tuscany 1.6? Couldn't find it in JIRA,
but maybe my search was not good.

A service with an RMI binding cannot be promoted, because when
the binding for the promoted service is processed, the Tuscany
CompositeActivatorImpl attempts to start the
RMIServiceBindingProvider
a second time, which leads to the DefaultRMIHost wanting to bind
the
service under the same name in the RMI registry, which produces an
AlreadyBoundException.

Here's a snippet from the composite.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
xmlns:ts="http://tuscany.apache.org/xmlns/sca/1.0";
name="logger_composite"
targetNamespace="http://ps.softwareag.com/";>
  <component name="SLF4JAdapterComponent">
    <implementation.java

class="com.softwareag.ps.platform.logadapter.impl.SLF4JAdapterImpl"/>
    <service name="LogAdapterService">
      <interface.java

interface="com.softwareag.ps.platform.logadapter.LogAdapterService"/>
      <binding.sca/>
      <ts:binding.rmi host="localhost" port="1099"
serviceName="LogAdapterServiceRMI"/>  <!-- *** -->
    </service>
  </component>
  <service name="SLF4JLogAdapterService"
promote="SLF4JAdapterComponent/LogAdapterService"/> <!-- *** -->
</composite>

-- Sebastian

Hi Sebastien

Is the promoted service being used by a component implemented using
implementation.composite? What is the service name that it thinks is
being registered twice?

Simon

--
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com


Reply via email to