Great. We can try to make some of the INFO log messages to FINE level later.

I also checked in a test case under /itest-nodes-two-nodes-test/src/test/java/itest/ClientNode.java. It creates two nodes in the same JVM but under different classloaders. With some local changes I have (passing the physical binding URI and selecting a free port for remote binding.sca), it works in Eclipse with endpoint-tribes.

Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <[email protected]>
Sent: Thursday, June 25, 2009 6:39 AM
To: <[email protected]>; <[email protected]>
Subject: Re: [2.x] remote binding.sca

I had some success with itest-nodes-two-nodes-two-vms-test. I have a
few local changes to bring the tribes base endpoint registry into
play. This is the (rather long) output I get. The first "run" is ant
bringing up the frist (server) VM. The second "run2, which overlaps
the first slightly,  is ant bringing up the client.

run:
[java] 25-Jun-2009 13:54:50 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: SCA Node configuration: file:./server-config.xml
[java] 25-Jun-2009 13:54:51 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: Apache Tuscany SCA Node is starting...
[java] 25-Jun-2009 13:54:51 org.apache.tuscany.sca.node.impl.NodeImpl start

    [java] INFO: Starting node: http://sample/nodes/TestNode1
[java] 25-Jun-2009 13:54:51 org.apache.tuscany.sca.endpoint.tribes.Abstract
ReplicatedMap init
[java] INFO: Initializing AbstractReplicatedMap with context name:http://tu
scany.apache.org/sca/1.1/domains/default
[java] 25-Jun-2009 13:54:51 org.apache.catalina.tribes.transport.ReceiverBa
se bind
    [java] INFO: Receiver Server Socket bound to:/9.146.152.23:4000
[java] 25-Jun-2009 13:54:51 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
[java] INFO: Attempting to bind the multicast socket to /228.0.0.100:50000 [java] 25-Jun-2009 13:54:51 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
[java] INFO: Binding to multicast address, failed. Binding to port only. [java] 25-Jun-2009 13:54:51 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
[java] INFO: Setting multihome multicast interface to:localhost/127.0.0.1 [java] 25-Jun-2009 13:54:51 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
    [java] INFO: Setting cluster mcast soTimeout to 500
[java] 25-Jun-2009 13:54:51 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
[java] INFO: Sleeping for 1000 milliseconds to establish cluster membership
, start level:4
[java] 25-Jun-2009 13:54:52 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
    [java] INFO: Done sleeping, membership established, start level:4
[java] 25-Jun-2009 13:54:52 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
[java] INFO: Sleeping for 1000 milliseconds to establish cluster membership
, start level:8
[java] 25-Jun-2009 13:54:53 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
    [java] INFO: Done sleeping, membership established, start level:8
[java] 25-Jun-2009 13:54:53 org.apache.tuscany.sca.node.impl.NodeFactoryImp
l configureNode
[java] INFO: Loading contribution: file:../helloworld-iface/target/itest-no
des-helloworld-iface-2.0-SNAPSHOT.jar
[java] 25-Jun-2009 13:54:53 org.apache.tuscany.sca.node.impl.NodeFactoryImp
l configureNode
[java] INFO: Loading contribution: file:../helloworld-service/target/itest-
nodes-helloworld-service-2.0-SNAPSHOT.jar

run:
[java] 25-Jun-2009 13:54:54 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: SCA Node configuration: file:./client-config.xml
[java] 25-Jun-2009 13:54:55 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: Apache Tuscany SCA Node is starting...
[java] 25-Jun-2009 13:54:55 org.apache.tuscany.sca.node.impl.NodeImpl start

    [java] INFO: Starting node: http://sample/nodes/TestNode1
[java] 25-Jun-2009 13:54:55 org.apache.tuscany.sca.endpoint.tribes.Abstract
ReplicatedMap init
[java] INFO: Initializing AbstractReplicatedMap with context name:http://tu
scany.apache.org/sca/1.1/domains/default
[java] 25-Jun-2009 13:54:55 org.apache.catalina.tribes.transport.ReceiverBa
se bind
    [java] INFO: Receiver Server Socket bound to:/9.146.152.23:4001
[java] 25-Jun-2009 13:54:55 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
[java] INFO: Attempting to bind the multicast socket to /228.0.0.100:50000 [java] 25-Jun-2009 13:54:55 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
[java] INFO: Binding to multicast address, failed. Binding to port only. [java] 25-Jun-2009 13:54:55 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
[java] INFO: Setting multihome multicast interface to:localhost/127.0.0.1 [java] 25-Jun-2009 13:54:55 org.apache.catalina.tribes.membership.McastServ
iceImpl setupSocket
    [java] INFO: Setting cluster mcast soTimeout to 500
[java] 25-Jun-2009 13:54:55 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
[java] INFO: Sleeping for 1000 milliseconds to establish cluster membership
, start level:4
[java] - No JMS connection factories are defined.Will not listen for any JM
S messages
[java] - No JMS connection factories are defined.Will not listen for any JM
S messages
[java] 25-Jun-2009 13:54:56 org.apache.tuscany.sca.http.jetty.JettyServer a
ddServletMapping
[java] INFO: Added Servlet mapping: http://L3AW203:8081/sca/HelloworldServi
ce/Helloworld
[java] 25-Jun-2009 13:54:56 org.apache.tuscany.sca.endpoint.tribes.Replicat
edEndpointRegistry addEndpoint
[java] INFO: Add endpoint - Endpoint: URI = HelloworldService#service-bind
ing(Helloworld/Helloworld)
[java] 25-Jun-2009 13:54:56 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: SCA Node is now started.
[java] 25-Jun-2009 13:54:56 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: Press 'q' to quit, 'r' to restart.
[java] 25-Jun-2009 13:54:56 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
    [java] INFO: Done sleeping, membership established, start level:4
[java] 25-Jun-2009 13:54:56 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
[java] INFO: Sleeping for 1000 milliseconds to establish cluster membership
, start level:8
[java] 25-Jun-2009 13:54:57 org.apache.catalina.tribes.membership.McastServ
iceImpl waitForMembers
    [java] INFO: Done sleeping, membership established, start level:8
[java] 25-Jun-2009 13:54:57 org.apache.tuscany.sca.node.impl.NodeFactoryImp
l configureNode
[java] INFO: Loading contribution: file:../helloworld-iface/target/itest-no
des-helloworld-iface-2.0-SNAPSHOT.jar
[java] 25-Jun-2009 13:54:57 org.apache.tuscany.sca.node.impl.NodeFactoryImp
l configureNode
[java] INFO: Loading contribution: file:../helloworld-client/target/itest-n
odes-helloworld-client-2.0-SNAPSHOT.jar
[java] 25-Jun-2009 13:54:58 org.apache.catalina.tribes.io.BufferPool getBuf
ferPool
[java] INFO: Created a buffer pool with max size:104857600 bytes of type:or
g.apache.catalina.tribes.io.BufferPool15Impl
[java] 25-Jun-2009 13:54:58 org.apache.catalina.tribes.io.BufferPool getBuf
ferPool
[java] INFO: Created a buffer pool with max size:104857600 bytes of type:or
g.apache.catalina.tribes.io.BufferPool15Impl
[java] 25-Jun-2009 13:54:58 org.apache.tuscany.sca.endpoint.tribes.Replicat
edEndpointRegistry entryAdded
[java] INFO: Remote endpoint added: Endpoint: URI = HelloworldService#serv
ice-binding(Helloworld/Helloworld)
[java] 25-Jun-2009 13:54:59 org.apache.tuscany.sca.assembly.builder.impl.Co
mponentReferenceEndpointReferenceBuilderImpl
[java] WARNING: Component reference target not found, it might be a remote service running elsewhere in the SCA Domain: Composite = {http://tuscany.apache.
org/xmlns/sca/1.1}_tempComposite Service = HelloworldService
[java] 25-Jun-2009 13:54:59 org.apache.tuscany.sca.assembly.builder.impl.Co
mponentReferenceEndpointReferenceBuilderImpl
[java] WARNING: Component reference target not found, it might be a remote service running elsewhere in the SCA Domain: Composite = {http://tuscany.apache.
org/xmlns/sca/1.1}_tempComposite Service = HelloworldService
[java] - No JMS connection factories are defined.Will not listen for any JM
S messages
[java] - No JMS connection factories are defined.Will not listen for any JM
S messages
[java] 25-Jun-2009 13:55:00 org.apache.tuscany.sca.http.jetty.JettyServer a
ddServletMapping
[java] INFO: Added Servlet mapping: http://L3AW203:8081/sca/HelloworldClien
t/Helloworld
[java] 25-Jun-2009 13:55:00 org.apache.tuscany.sca.endpoint.tribes.Replicat
edEndpointRegistry addEndpoint
[java] INFO: Add endpoint - Endpoint: URI = HelloworldClient#service-bindi
ng(Helloworld/Helloworld)
[java] 25-Jun-2009 13:55:00 org.apache.tuscany.sca.endpoint.tribes.Replicat
edEndpointRegistry addEndpointReference
[java] INFO: Add endpoint reference - Endpoint Reference: URI = Helloworld Client#reference(service) [Unresolved] Target = Endpoint: URI = HelloworldServi
ce [Unresolved]
[java] 25-Jun-2009 13:55:00 org.apache.tuscany.sca.endpoint.tribes.Replicat
edEndpointRegistry findEndpoint
[java] INFO: Find endpoint for reference - Endpoint Reference: URI = Hello worldClient#reference(service) [Unresolved] Target = Endpoint: URI = Helloworld
Service [Unresolved]
[java] 25-Jun-2009 13:55:00 org.apache.tuscany.sca.endpoint.tribes.Replicat
edEndpointRegistry findEndpoint
[java] INFO: Found endpoint with matching service - Endpoint: URI = Hello
worldService#service-binding(Helloworld/Helloworld)
    [java] >>>>>> Hi Hello init
[java] 25-Jun-2009 13:55:01 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: SCA Node is now started.
[java] 25-Jun-2009 13:55:01 org.apache.tuscany.sca.node.launcher.NodeLaunch
er main
    [java] INFO: Waiting for 0 milliseconds ...
[java] 25-Jun-2009 13:55:01 org.apache.tuscany.sca.node.impl.NodeImpl stop
    [java] INFO: Stopping node: http://sample/nodes/TestNode1
[java] 25-Jun-2009 13:55:01 org.apache.tuscany.sca.endpoint.tribes.Replicat
edEndpointRegistry removeEndpoint
[java] INFO: Remove endpoint - Endpoint: URI = HelloworldClient#service-bi
nding(Helloworld/Helloworld)
[java] 25-Jun-2009 13:55:01 org.apache.tuscany.sca.http.jetty.JettyServer r
emoveServletMapping
    [java] INFO: Removed Servlet mapping: /sca/HelloworldClient/Helloworld
[java] 25-Jun-2009 13:55:01 org.apache.tuscany.sca.node.launcher.NodeLaunch
er stopNode
    [java] INFO: SCA Node is now stopped.
[java] 25-Jun-2009 13:55:01 org.apache.catalina.tribes.membership.McastServ
iceImpl$ReceiverThread run


The  ">>>>>> Hi Hello init" shows it uses the web services version of
binding.sca to talk between the vms.

The launch commands for the server and client are basically (not
showing classpath - in this test it's done from ant)

java org.apache.tuscany.sca.node.launcher.NodeMain -node
file:./server-config.xml
java org.apache.tuscany.sca.node.launcher.NodeMain -node
file:./client-config.xml

Where service-config.xml is the info you normally push into node
creation + the binding defaults...

<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903";
   xmlns="http://tuscany.apache.org/xmlns/sca/1.1";
   xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1";
   uri="http://sample/nodes/TestNode1";
   domain="http://domain1";>

   <!-- Configure the base URIs for a given binding -->
   <!-- Each base URI is for a protocol supported by the binding -->
   <binding name="sca:binding.sca" baseURIs="http://localhost:8081/sca"/>

   <!-- Configure a list of contributions -->
   <contribution uri="iface"
location="file:../helloworld-iface/target/itest-nodes-helloworld-iface-2.0-SNAPSHOT.jar"/>
   <contribution uri="service"
location="file:../helloworld-service/target/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar">
<!-- doesn't pick up the deployable composite properly without this?-->
       <deploymentComposite location="helloworld-service.composite"/>
   </contribution>

</node>

The client is very similar except that it loads a different contribution

Couple of issues. Firstly I'm suspicious that the client is seemingly
able to use the same port that the service is using to expose a
service. Also it seems to fail depending on the timing between
starting the server and client.

Simon

Reply via email to