You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Martin Thoma <m....@b2m-software.de> on 2009/06/26 17:12:54 UTC

warnings using callbacks

Hello,

we implemented some kind of registering and broadcasting for one server and multiple clients
running on different hosts using tuscany 1.3.1

The server implements two interfaces:

The server interfaces:
UpdateProvider for initiating the broadcast and 
UpdateRegistry for the clients to register to the server.

Here are the interfaces for the server
@Remotable
public interface UpdateProvider {
	public void broadcast(String e);
}

and

@Remotable
@Callback(UpdateListener.class)
public interface UpdateRegistry {

	void register();
}

The server implementation:

public class UpdateServiceImpl implements UpdateProvider, UpdateRegistry {

	@Callback
	protected UpdateListener updateListener;

	private static List<UpdateListener> listeners = new Vector<UpdateListener>();

	public void broadcast(String e) {
		for (UpdateListener listener: listeners)
			listener.receiveUpdate(e)
	}

	public void register() {
		listeners.add(updateListener);
	}
}

and the server composite:

<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
	targetNamespace="http://updateservice"
	xmlns:hw="http://updateservice"
	name="Updateservice">

	<component name="UpdateServiceImplComp">
		<implementation.java class="test.UpdateServiceImpl"/>
		<service name="UpdateProvider">
			<binding.ws/>
		</service>
		<service name="UpdateRegistry">
			<binding.ws/>
			<callback>
				<binding.ws/>
			</callback>
		</service>
	</component>
</composite>


The clients have one interface for receiving the broadcasted event:

@Remotable
public interface UpdateListener {
	void receiveUpdate(String re);
}

the client implementation

@Scope("COMPOSITE")
public class UpdateListenerImpl implements UpdateListener {

	@Reference
	protected UpdateRegistry updateRegistry;

	public void receiveUpdate(String e) {}
	public void init(){	updateRegistry.register();	}
}

and the client composite:

<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
	targetNamespace="http://updatelistener"
	xmlns:hw="http://updatelistener"
	name="UpdateListener">

	<component name="UpdateListenerImplCompHostA">
		<implementation.java class="test.UpdateListenerImpl"/>
		<service name="UpdateListener">
			<binding.ws/>
		</service>
		<reference name="updateRegistry" target="UpdateServiceImplComp/UpdateRegistry">
			<binding.ws/>
			<callback>
				<binding.ws uri="http://hosta:5501/UpdateListenerImplCompHostA/UpdateListener"/>
			</callback>
		</reference>
	</component>
</composite>

Everything works fine,
the clients running on different hosts
receive the broadcasted events.

The only "problem":
we got the following warnings:


26.06.2009 14:25:52 org.apache.tuscany.sca.node.launcher.NodeLauncher main
INFO: Apache Tuscany SCA Node starting...
26.06.2009 14:25:52 org.apache.tuscany.sca.node.launcher.NodeLauncher main
INFO: SCA Node configuration: http://localhost:9990/node-config/UpdateserviceNode
26.06.2009 14:25:53 org.apache.tuscany.sca.node.impl.NodeImpl 
INFO: Creating node: http://localhost:9990/node-config/UpdateserviceNode
26.06.2009 14:25:53 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading contribution: file:/./components/updateservice.jar
26.06.2009 14:25:55 org.apache.tuscany.sca.node.impl.NodeImpl configureNode
INFO: Loading composite: http://localhost:9990/composite-resolved/composite:updateservice;http://updateservice;Updateservice
26.06.2009 14:25:55 org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl
WARNUNG: Reference not found for component reference: Component = UpdateServiceImplComp Reference = UpdateRegistry
26.06.2009 14:25:55 org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
WARNUNG: Reference not found for component reference: Component = UpdateServiceImplComp Reference = UpdateRegistry
26.06.2009 14:25:55 org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
WARNUNG: Multiple bindings with the same name for a service: Binding = UpdateRegistry Service =UpdateRegistry Binding = {2}
26.06.2009 14:25:56 org.apache.tuscany.sca.node.impl.NodeImpl start
INFO: Starting node: http://localhost:9990/node-config/UpdateserviceNode
26.06.2009 14:25:57 org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
INFO: Added Servlet mapping: http://roadrunner:5000/UpdateServiceImplComp/UpdateProvider
26.06.2009 14:25:57 org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
INFO: Added Servlet mapping: http://roadrunner:5000/UpdateServiceImplComp/UpdateRegistry
26.06.2009 14:25:57 org.apache.tuscany.sca.node.launcher.NodeLauncher main
INFO: SCA Node started.
26.06.2009 14:25:57 org.apache.tuscany.sca.node.launcher.NodeLauncher main
INFO: Press enter to shutdown.

Is it possible to avoid this warnings somehow ?

Mit freundlichem Gruß / Kind regards

Martin Thoma


Re: warnings using callbacks

Posted by Simon Nash <na...@apache.org>.
ant elder wrote:
> On Fri, Jun 26, 2009 at 10:44 PM, Simon Nash<na...@apache.org> wrote:
>> Simon Laws wrote:
>>>> The service has a forward <binding.ws/> and a callback <binding.ws/>.
>>>> These have no "name=" attribute, so they both default to the name of
>>>> the service.  SCA doesn't permit two bindings with the same name, and
>>>> this is why you get the warning.  The {2} in the message is a bug in
>>>> the 1.3.1 message template, and has been fixed in the latest code.
>>>>
>>> Interesting. I didn't realize that the it checked across both forward
>>> and callback binding collections to determine uniqueness of binding
>>> name.
>>>
>>> Simon
>>>
>>>
>> I discovered this when doing some experiments with callback bindings
>> recently.  Tuscany works this way, and the SCA spec doesn't say whether
>> or not the scope of callback binding name uniqueness should be distinct
>> from the forward bindings.
>>
>> If anyone feels that this should be changed, I would be happy to raise a
>> spec issue.  It does seem to be a bit of a pitfall that catches people out.
>>
>>  Simon
>>
>>
> 
> It does sound like it should be changed to me. From what the user is
> saying this is actually running fine so its doesn't seem good to
> require them to add a bit more xml config for no other purpose than to
> avoid an unnecessarily strict name check warning message.
> 
>    ...ant
> 
I have raised a spec issue for this, with a proposal that uniqueness
should be required between forward binding names and (separately)
between callback binding names.

   Simon


Re: warnings using callbacks

Posted by ant elder <an...@gmail.com>.
On Fri, Jun 26, 2009 at 10:44 PM, Simon Nash<na...@apache.org> wrote:
> Simon Laws wrote:
>>>
>>> The service has a forward <binding.ws/> and a callback <binding.ws/>.
>>> These have no "name=" attribute, so they both default to the name of
>>> the service.  SCA doesn't permit two bindings with the same name, and
>>> this is why you get the warning.  The {2} in the message is a bug in
>>> the 1.3.1 message template, and has been fixed in the latest code.
>>>
>>
>> Interesting. I didn't realize that the it checked across both forward
>> and callback binding collections to determine uniqueness of binding
>> name.
>>
>> Simon
>>
>>
> I discovered this when doing some experiments with callback bindings
> recently.  Tuscany works this way, and the SCA spec doesn't say whether
> or not the scope of callback binding name uniqueness should be distinct
> from the forward bindings.
>
> If anyone feels that this should be changed, I would be happy to raise a
> spec issue.  It does seem to be a bit of a pitfall that catches people out.
>
>  Simon
>
>

It does sound like it should be changed to me. From what the user is
saying this is actually running fine so its doesn't seem good to
require them to add a bit more xml config for no other purpose than to
avoid an unnecessarily strict name check warning message.

   ...ant

Re: warnings using callbacks

Posted by Simon Nash <na...@apache.org>.
Simon Laws wrote:
>> The service has a forward <binding.ws/> and a callback <binding.ws/>.
>> These have no "name=" attribute, so they both default to the name of
>> the service.  SCA doesn't permit two bindings with the same name, and
>> this is why you get the warning.  The {2} in the message is a bug in
>> the 1.3.1 message template, and has been fixed in the latest code.
>>
> 
> Interesting. I didn't realize that the it checked across both forward
> and callback binding collections to determine uniqueness of binding
> name.
> 
> Simon
> 
> 
I discovered this when doing some experiments with callback bindings
recently.  Tuscany works this way, and the SCA spec doesn't say whether
or not the scope of callback binding name uniqueness should be distinct
from the forward bindings.

If anyone feels that this should be changed, I would be happy to raise a
spec issue.  It does seem to be a bit of a pitfall that catches people out.

   Simon


Re: warnings using callbacks

Posted by Simon Laws <si...@googlemail.com>.
> The service has a forward <binding.ws/> and a callback <binding.ws/>.
> These have no "name=" attribute, so they both default to the name of
> the service.  SCA doesn't permit two bindings with the same name, and
> this is why you get the warning.  The {2} in the message is a bug in
> the 1.3.1 message template, and has been fixed in the latest code.
>

Interesting. I didn't realize that the it checked across both forward
and callback binding collections to determine uniqueness of binding
name.

Simon

Re: AW: warnings using callbacks

Posted by Simon Nash <na...@apache.org>.
Martin Thoma wrote:
>> -----Ursprüngliche Nachricht-----
>> Von: Simon Nash [mailto:nash@apache.org]
>> Gesendet: Freitag, 26. Juni 2009 18:54
>> An: user@tuscany.apache.org
>> Betreff: Re: warnings using callbacks
>>
>> Simon Laws wrote:
>>> Hi Martin
> 
> Hi Simon,
> 
>>> WARNUNG: Reference not found for component reference: Component =
>>> UpdateServiceImplComp Reference = UpdateRegistry
>>>
>>> Means that there is a reference in a composite whose name doesn't
>>> match a reference in the component implementation. This is
>> missleading
>>> here though I think because it's complaining about the automatically
>>> created callback reference that takes the name of the service for
>>> which it is the callback reference. Please raise a JIRA for this.
>>>
>> This works OK in other examples, so I have a suspicion that the
>> problem is associated with using the domain manager to start the node.
>> My guess is that the domain manager is adding an extra reference
>> to the runtime composite that it sends to the node.  The domain manager
>> should not do this, but should leave it to the node to create the
>> extra reference representing the callback.  We can look into this
>> as part of the JIRA investigation.
>>
> 
> In addition:
> For the clients I got the warnings
> WARNUNG: Service not found for component service: Component = UpdateListenerImplCompHostA Service = updateRegistry
> WARNUNG: Skipping component service not defined in the component type: UpdateListenerImplCompHostA#updateRegistry
> 
> I guess this is the counterpart for the above warning.
> If necessary how can I open a JIRA ?
> 
Martin,
Are you able to try this with the newest 1.5 release of Tuscany?
I have been running similar application code on this level of Tuscany
without seeing any of these problems.  It is possible that this may be
a problem that has already been fixed.

   Simon

> 
>>> WARNUNG: Multiple bindings with the same name for a service: Binding
>> =
>>> UpdateRegistry Service =UpdateRegistry Binding = {2}
>>>
>>> Means there are multiple bindings with no name on the service
>>> "UpdateRegistry". Again this is a little strange. I don't know why it
>>> would be adding another binding in this case. The error message is
>>> also very strange. Can you add this to the JIRA also and we'll take a
>>> look at it.
>>>
>> The service has a forward <binding.ws/> and a callback <binding.ws/>.
>> These have no "name=" attribute, so they both default to the name of
>> the service.  SCA doesn't permit two bindings with the same name, and
>> this is why you get the warning.  The {2} in the message is a bug in
>> the 1.3.1 message template, and has been fixed in the latest code.
>>
>> Tuscany is doing the right thing by producing the warning.  The
>> solution
>> is to change the service callback binding to something like
>> <binding.ws name="UpdateRegistryCallback"/>.
> 
> After doing so I got the warning
> WARNUNG: Multiple bindings with the same name for a reference: Binding = updateRegistry Reference = updateRegistry Binding = {2}
> so I did the same for the callback binding of the reference
> and the warnings disappeared.
> 
> Thanks.
> 
> 
>>    Simon N.
>>
>>> Regards
>>>
>>> Simon
>>>
>>>
> Martin
> 
> 



AW: warnings using callbacks

Posted by Martin Thoma <m....@b2m-software.de>.
> -----Ursprüngliche Nachricht-----
> Von: Simon Nash [mailto:nash@apache.org]
> Gesendet: Freitag, 26. Juni 2009 18:54
> An: user@tuscany.apache.org
> Betreff: Re: warnings using callbacks
> 
> Simon Laws wrote:
> > Hi Martin

Hi Simon,

> >
> > WARNUNG: Reference not found for component reference: Component =
> > UpdateServiceImplComp Reference = UpdateRegistry
> >
> > Means that there is a reference in a composite whose name doesn't
> > match a reference in the component implementation. This is
> missleading
> > here though I think because it's complaining about the automatically
> > created callback reference that takes the name of the service for
> > which it is the callback reference. Please raise a JIRA for this.
> >
> This works OK in other examples, so I have a suspicion that the
> problem is associated with using the domain manager to start the node.
> My guess is that the domain manager is adding an extra reference
> to the runtime composite that it sends to the node.  The domain manager
> should not do this, but should leave it to the node to create the
> extra reference representing the callback.  We can look into this
> as part of the JIRA investigation.
> 

In addition:
For the clients I got the warnings
WARNUNG: Service not found for component service: Component = UpdateListenerImplCompHostA Service = updateRegistry
WARNUNG: Skipping component service not defined in the component type: UpdateListenerImplCompHostA#updateRegistry

I guess this is the counterpart for the above warning.
If necessary how can I open a JIRA ?


> > WARNUNG: Multiple bindings with the same name for a service: Binding
> =
> > UpdateRegistry Service =UpdateRegistry Binding = {2}
> >
> > Means there are multiple bindings with no name on the service
> > "UpdateRegistry". Again this is a little strange. I don't know why it
> > would be adding another binding in this case. The error message is
> > also very strange. Can you add this to the JIRA also and we'll take a
> > look at it.
> >
> The service has a forward <binding.ws/> and a callback <binding.ws/>.
> These have no "name=" attribute, so they both default to the name of
> the service.  SCA doesn't permit two bindings with the same name, and
> this is why you get the warning.  The {2} in the message is a bug in
> the 1.3.1 message template, and has been fixed in the latest code.
> 
> Tuscany is doing the right thing by producing the warning.  The
> solution
> is to change the service callback binding to something like
> <binding.ws name="UpdateRegistryCallback"/>.

After doing so I got the warning
WARNUNG: Multiple bindings with the same name for a reference: Binding = updateRegistry Reference = updateRegistry Binding = {2}
so I did the same for the callback binding of the reference
and the warnings disappeared.

Thanks.


> 
>    Simon N.
> 
> > Regards
> >
> > Simon
> >
> >
> 
Martin

Re: warnings using callbacks

Posted by Simon Nash <na...@apache.org>.
Simon Laws wrote:
> Hi Martin
> 
> WARNUNG: Reference not found for component reference: Component =
> UpdateServiceImplComp Reference = UpdateRegistry
> 
> Means that there is a reference in a composite whose name doesn't
> match a reference in the component implementation. This is missleading
> here though I think because it's complaining about the automatically
> created callback reference that takes the name of the service for
> which it is the callback reference. Please raise a JIRA for this.
> 
This works OK in other examples, so I have a suspicion that the
problem is associated with using the domain manager to start the node.
My guess is that the domain manager is adding an extra reference
to the runtime composite that it sends to the node.  The domain manager
should not do this, but should leave it to the node to create the
extra reference representing the callback.  We can look into this
as part of the JIRA investigation.

> WARNUNG: Multiple bindings with the same name for a service: Binding =
> UpdateRegistry Service =UpdateRegistry Binding = {2}
> 
> Means there are multiple bindings with no name on the service
> "UpdateRegistry". Again this is a little strange. I don't know why it
> would be adding another binding in this case. The error message is
> also very strange. Can you add this to the JIRA also and we'll take a
> look at it.
> 
The service has a forward <binding.ws/> and a callback <binding.ws/>.
These have no "name=" attribute, so they both default to the name of
the service.  SCA doesn't permit two bindings with the same name, and
this is why you get the warning.  The {2} in the message is a bug in
the 1.3.1 message template, and has been fixed in the latest code.

Tuscany is doing the right thing by producing the warning.  The solution
is to change the service callback binding to something like
<binding.ws name="UpdateRegistryCallback"/>.

   Simon N.

> Regards
> 
> Simon
> 
> 



Re: warnings using callbacks

Posted by Simon Laws <si...@googlemail.com>.
Hi Martin

WARNUNG: Reference not found for component reference: Component =
UpdateServiceImplComp Reference = UpdateRegistry

Means that there is a reference in a composite whose name doesn't
match a reference in the component implementation. This is missleading
here though I think because it's complaining about the automatically
created callback reference that takes the name of the service for
which it is the callback reference. Please raise a JIRA for this.

WARNUNG: Multiple bindings with the same name for a service: Binding =
UpdateRegistry Service =UpdateRegistry Binding = {2}

Means there are multiple bindings with no name on the service
"UpdateRegistry". Again this is a little strange. I don't know why it
would be adding another binding in this case. The error message is
also very strange. Can you add this to the JIRA also and we'll take a
look at it.

Regards

Simon