You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Ha...@l-3com.com on 2010/02/18 17:52:23 UTC

distributed callback-jms problem

I'm trying to make the callback-jms sample in 1.6 to be distributed like
the calculator-distributed sample.  I ran into several problems:

1.  I got this warning when running my service: WARNING: Component
reference target not found, it might be a remote service running
elsewhere in the SCA Domain: Composite =
{http://sample}MyClientComposite Service =
ServiceComponent/OrderService. I don't know if this is the problem that
causes the callback to not work.

2.  From the service side, it receives the order from the client but
when setCallbackReference(OrderCallback theCallback)is invoked
theCallback is null. So the callback does not work.

3.  The composite files generated at
http://localhost:9990/composite-resolved/... has this weird uri (ie,
uri="/ServiceComponent") in the binding.jms that causes the node failed
to create when I started it via http://localhost:9990/ui/cloud. I have
no idea how these composites were created.

 

Below are the all the composites and output:

 

Client:

 

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"

           targetNamespace="http://sample"

           name="MyClientComposite">

 

    <component name="ClientComponent">

        <implementation.java class="callbacks.OrderServiceClient" />

        <reference name="orderService"
target="ServiceComponent/OrderService">

            <binding.jms uri="jms:OrderService"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            <callback>

                <binding.jms uri="jms:callback"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            </callback>

        </reference>

    </component>

      

</composite>

 

Runtime output:

     [java] Feb 18, 2010 10:02:12 AM
org.apache.tuscany.sca.node.impl.NodeImpl <init>

     [java] INFO: Creating node: clients/ngtsScenarioLibClient.composite

     [java] Feb 18, 2010 10:02:13 AM
org.apache.tuscany.sca.node.impl.NodeImpl configureNode

     [java] INFO: Loading contribution:
file:/home/ha/Projects/SCA/callbacks-jms/target/sample-callbacks-jms.jar

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderI
mpl

     [java] WARNING: Multiple bindings with the same name for a
reference: Reference = orderService Binding name = orderService

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuild
erImpl

     [java] WARNING: Component reference target not found, it might be a
remote service running elsewhere in the SCA Domain: Composite =
{http://sample}MyClientComposite Service = ServiceComponent/OrderService

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.node.impl.NodeImpl start

     [java] INFO: Starting node: clients/ngtsScenarioLibClient.composite

     [java] - channel status changed: Channel: TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=61616,localport=33048] has
connected

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.host.jms.asf.ASFListener registerListerner

     [java] INFO: JMS callback service 'orderService' listening on
destination callback

     [java] client placing order: callbacks.OrderRequest@f12b72

     [java] - channel status changed: Channel: TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=61616,localport=33049] has
connected

 

Service:

 

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"

           targetNamespace="http://sample"

           name="MyServiceComposite">

 

    <component name="ServiceComponent">

        <implementation.java class="callbacks.OrderServiceImpl" />

        <service name="OrderService">

            <binding.jms
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            <callback>

                <binding.jms uri="jms:callback"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            </callback>

        </service>

    </component>

    

</composite>

 

Runtime output:

     [java] Feb 18, 2010 10:02:06 AM
org.apache.tuscany.sca.node.impl.NodeImpl <init>

     [java] INFO: Creating node: services/scenarioService.composite

     [java] Feb 18, 2010 10:02:06 AM
org.apache.tuscany.sca.node.impl.NodeImpl configureNode

     [java] INFO: Loading contribution:
file:/home/ha/Projects/SCA/callbacks-jms/target/sample-callbacks-jms.jar

     [java] Feb 18, 2010 10:02:07 AM
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderI
mpl

     [java] WARNING: Multiple bindings with the same name for a service:
Service = OrderService Binding name = OrderService

     [java] Feb 18, 2010 10:02:07 AM
org.apache.tuscany.sca.node.impl.NodeImpl start

     [java] INFO: Starting node: services/scenarioService.composite

     [java] - channel status changed: Channel: TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=61616,localport=33046] has
connected

     [java] Feb 18, 2010 10:02:08 AM
org.apache.tuscany.sca.host.jms.asf.ASFListener registerListerner

     [java] INFO: JMS service 'OrderService' listening on destination
OrderServiceTopic     

     [java] ============>OrderServiceImpl.setCallbackReference(): null

     [java] service received order: callbacks.OrderRequest@1332109

 

////////////////

 

Composite files at http://localhost:9990/composite-resolved... that has
this weird uri (i.e, uri="/ServiceComponent")that caused the node failed
to create:

 

<composite targetNamespace="http://sample" name="MyClientComposite">

      

      <component name="ClientComponent" uri="ClientComponent">

            <implementation.java class="callbacks.OrderServiceClient" />

            

            <service name="OrderServiceClient">

                  <interface.java
interface="callbacks.OrderServiceClient" />

                  <binding.sca name="OrderServiceClient"
uri="/ClientComponent" />

                  <callback />

            </service>

            

            <reference name="orderService">

                  <interface.java interface="callbacks.OrderService"

                        callbackInterface="callbacks.OrderCallback" />

                  

                  <binding.jms
name="orderService--ServiceComponent..OrderService"

                        uri="/ServiceComponent"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                        jndiURL="tcp://localhost:61616">

                        <destination name="OrderService" />

                  </binding.jms>

                  

                  <callback>

                        

                        <binding.jms
name="orderService--ServiceComponent..OrderService"

                              uri="/ClientComponent/orderService"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                              jndiURL="tcp://localhost:61616">

                              <destination name="callback" />

                        </binding.jms>

                  </callback>

            </reference>

      </component>

</composite>

 

<composite targetNamespace="http://sample" name="MyServiceComposite">

      

      <component name="ServiceComponent" uri="ServiceComponent">

            <implementation.java class="callbacks.OrderServiceImpl" />

            

            <service name="OrderService">

                  <interface.java interface="callbacks.OrderService"

                        callbackInterface="callbacks.OrderCallback" />

                  <binding.jms name="OrderService"
uri="/ServiceComponent"

 
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                        jndiURL="tcp://localhost:61616" />

                  

                  <callback>                    

                        <binding.jms name="OrderService"

 
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                              jndiURL="tcp://localhost:61616">

                              <destination name="callback" />

                        </binding.jms>

                  </callback>

            </service>

      </component>

</composite>

 

 

Thank you in advance, sorry for the long post.

Ha


RE: distributed callback-jms problem

Posted by Ha...@l-3com.com.
Are there other ways to pass data back to client beside using callback?

 

 

From: Ha.T.Dam@l-3com.com [mailto:Ha.T.Dam@l-3com.com] 
Sent: Thursday, February 18, 2010 10:52 AM
To: user@tuscany.apache.org
Subject: distributed callback-jms problem

 

I'm trying to make the callback-jms sample in 1.6 to be distributed like
the calculator-distributed sample.  I ran into several problems:

1.  I got this warning when running my service: WARNING: Component
reference target not found, it might be a remote service running
elsewhere in the SCA Domain: Composite =
{http://sample}MyClientComposite Service =
ServiceComponent/OrderService. I don't know if this is the problem that
causes the callback to not work.

2.  From the service side, it receives the order from the client but
when setCallbackReference(OrderCallback theCallback)is invoked
theCallback is null. So the callback does not work.

3.  The composite files generated at
http://localhost:9990/composite-resolved/... has this weird uri (ie,
uri="/ServiceComponent") in the binding.jms that causes the node failed
to create when I started it via http://localhost:9990/ui/cloud. I have
no idea how these composites were created.

 

Below are the all the composites and output:

 

Client:

 

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"

           targetNamespace="http://sample"

           name="MyClientComposite">

 

    <component name="ClientComponent">

        <implementation.java class="callbacks.OrderServiceClient" />

        <reference name="orderService"
target="ServiceComponent/OrderService">

            <binding.jms uri="jms:OrderService"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            <callback>

                <binding.jms uri="jms:callback"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            </callback>

        </reference>

    </component>

      

</composite>

 

Runtime output:

     [java] Feb 18, 2010 10:02:12 AM
org.apache.tuscany.sca.node.impl.NodeImpl <init>

     [java] INFO: Creating node: clients/ngtsScenarioLibClient.composite

     [java] Feb 18, 2010 10:02:13 AM
org.apache.tuscany.sca.node.impl.NodeImpl configureNode

     [java] INFO: Loading contribution:
file:/home/ha/Projects/SCA/callbacks-jms/target/sample-callbacks-jms.jar

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderI
mpl

     [java] WARNING: Multiple bindings with the same name for a
reference: Reference = orderService Binding name = orderService

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.assembly.builder.impl.ComponentReferenceWireBuild
erImpl

     [java] WARNING: Component reference target not found, it might be a
remote service running elsewhere in the SCA Domain: Composite =
{http://sample}MyClientComposite Service = ServiceComponent/OrderService

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.node.impl.NodeImpl start

     [java] INFO: Starting node: clients/ngtsScenarioLibClient.composite

     [java] - channel status changed: Channel: TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=61616,localport=33048] has
connected

     [java] Feb 18, 2010 10:02:14 AM
org.apache.tuscany.sca.host.jms.asf.ASFListener registerListerner

     [java] INFO: JMS callback service 'orderService' listening on
destination callback

     [java] client placing order: callbacks.OrderRequest@f12b72

     [java] - channel status changed: Channel: TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=61616,localport=33049] has
connected

 

Service:

 

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"

           targetNamespace="http://sample"

           name="MyServiceComposite">

 

    <component name="ServiceComponent">

        <implementation.java class="callbacks.OrderServiceImpl" />

        <service name="OrderService">

            <binding.jms
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            <callback>

                <binding.jms uri="jms:callback"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"
jndiURL="tcp://localhost:61616"/>

            </callback>

        </service>

    </component>

    

</composite>

 

Runtime output:

     [java] Feb 18, 2010 10:02:06 AM
org.apache.tuscany.sca.node.impl.NodeImpl <init>

     [java] INFO: Creating node: services/scenarioService.composite

     [java] Feb 18, 2010 10:02:06 AM
org.apache.tuscany.sca.node.impl.NodeImpl configureNode

     [java] INFO: Loading contribution:
file:/home/ha/Projects/SCA/callbacks-jms/target/sample-callbacks-jms.jar

     [java] Feb 18, 2010 10:02:07 AM
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderI
mpl

     [java] WARNING: Multiple bindings with the same name for a service:
Service = OrderService Binding name = OrderService

     [java] Feb 18, 2010 10:02:07 AM
org.apache.tuscany.sca.node.impl.NodeImpl start

     [java] INFO: Starting node: services/scenarioService.composite

     [java] - channel status changed: Channel: TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=61616,localport=33046] has
connected

     [java] Feb 18, 2010 10:02:08 AM
org.apache.tuscany.sca.host.jms.asf.ASFListener registerListerner

     [java] INFO: JMS service 'OrderService' listening on destination
OrderServiceTopic     

     [java] ============>OrderServiceImpl.setCallbackReference(): null

     [java] service received order: callbacks.OrderRequest@1332109

 

////////////////

 

Composite files at http://localhost:9990/composite-resolved... that has
this weird uri (i.e, uri="/ServiceComponent")that caused the node failed
to create:

 

<composite targetNamespace="http://sample" name="MyClientComposite">

      

      <component name="ClientComponent" uri="ClientComponent">

            <implementation.java class="callbacks.OrderServiceClient" />

            

            <service name="OrderServiceClient">

                  <interface.java
interface="callbacks.OrderServiceClient" />

                  <binding.sca name="OrderServiceClient"
uri="/ClientComponent" />

                  <callback />

            </service>

            

            <reference name="orderService">

                  <interface.java interface="callbacks.OrderService"

                        callbackInterface="callbacks.OrderCallback" />

                  

                  <binding.jms
name="orderService--ServiceComponent..OrderService"

                        uri="/ServiceComponent"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                        jndiURL="tcp://localhost:61616">

                        <destination name="OrderService" />

                  </binding.jms>

                  

                  <callback>

                        

                        <binding.jms
name="orderService--ServiceComponent..OrderService"

                              uri="/ClientComponent/orderService"
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                              jndiURL="tcp://localhost:61616">

                              <destination name="callback" />

                        </binding.jms>

                  </callback>

            </reference>

      </component>

</composite>

 

<composite targetNamespace="http://sample" name="MyServiceComposite">

      

      <component name="ServiceComponent" uri="ServiceComponent">

            <implementation.java class="callbacks.OrderServiceImpl" />

            

            <service name="OrderService">

                  <interface.java interface="callbacks.OrderService"

                        callbackInterface="callbacks.OrderCallback" />

                  <binding.jms name="OrderService"
uri="/ServiceComponent"

 
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                        jndiURL="tcp://localhost:61616" />

                  

                  <callback>                    

                        <binding.jms name="OrderService"

 
initialContextFactory="org.activemq.jndi.ActiveMQInitialContextFactory"

                              jndiURL="tcp://localhost:61616">

                              <destination name="callback" />

                        </binding.jms>

                  </callback>

            </service>

      </component>

</composite>

 

 

Thank you in advance, sorry for the long post.

Ha