Simon Laws wrote:


On Fri, Jul 4, 2008 at 10:58 AM, Hinde Bouziane <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi all,
    Trying to find an explanation to the problem, I executed the same
    application on a cluster using different machines. Except the
    names of the machines, I didn't change anything in the code/ xml
    descriptors. I had a successful execution :).

    I'm stilling not understanding what locally happens. Can you give
    me an explanation?

    Thank you,
    regards,
    Hinde


    Hinde Bouziane wrote:

        Hi all,
        I'm trying to launch an application with the following
        distributed architecture/configuration (with two nodes):

        **** ComponentA and ComponentActrl on Node_compA:
        node_compA.composite :
        <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
                 targetNamespace="http://sample";
                 xmlns:sample="http://sample";
                 name="Node_compA_comp">
          <component name="ComponentA">
              <implementation.java class="a_comp.A_Impl" />
          </component>
          <component name="ComponentActrl">
              <implementation.java class="a_comp.A_ctrl" />
              <reference name="userAtask" target="ComponentA" />
          <service name="Tmp_double">
            <interface.java interface="aSEQb.Tmp_double"/>
          </service>
          <service name="ActrlPorts">
            <interface.java interface="a_comp.ActrlPorts"/>
          </service>
          </component>
        </composite>

        cloud/Node_compA.composite:

        <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0";
              xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0";
              targetNamespace="http://sample/cloud";
              xmlns:s="http://sample";
              name="Node_compA">
          <component name="Node_compA">
              <t:implementation.node uri="node_compA"
        composite="s:Node_compA_comp"/>
              <service name="Node">
                  <binding.sca uri="http://localhost:8200"/>
              </service>
          </component>
        </composite>

        **** FakeComponentA on Node_fakeA
        node_fakeA.composite:
        <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
                 targetNamespace="http://sample";
                 xmlns:sample="http://sample";
                 name="Node_fakeA_comp">
          <component name="FakeComponentA">
              <implementation.java class="fake_comp.A_fake_Impl" />
              <reference name="fakeUseA"
         target="ComponentActrl/Tmp_double" />
              <reference name="fakeCtrlA"
        target="ComponentActrl/ActrlPorts" />
          </component>
        </composite>

        cloud/Node_fakeA.composite:

        <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0";
              xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0";
              targetNamespace="http://sample/cloud";
              xmlns:s="http://sample";
              name="Node_fakeA">
          <component name="Node_fakeA">
              <t:implementation.node uri="node_fakeA"
        composite="s:Node_fakeA_comp"/>
              <service name="Node">
                  <binding.sca uri="http://localhost:8100"/>
              </service>
          </component>
        </composite>

        --------------------

        A client program launches Node_fakeA, get the service
        ComponentActrl/Tmp_double. The associated interface is :

        @Remotable
        public interface Tmp_double {

          void set_double(double val);
          void set_void();
        }

        From the client program, the set_double(..) operation is
        called. It just make a call of the same operation on
        ComponentActrl. But at this point, an error occurs.

        Here is the relevant part of the Client program:

        public class ApplManagerWithFakeComp {

          public static void main(String[] args) throws Exception {
                   ....              // Create a fake_A node
                  NodeLauncher launcher = NodeLauncher.newInstance();
                  String configurationURI =
        "http://localhost:9990/node-image/Node_fakeA";;
                            SCANode2 node =
        launcher.createNode(configurationURI);
                                // Start the node
                  try {
                      node.getClass().getMethod("start").invoke(node);
                                    } catch (Exception e) {
                                        System.err.println("SCA
        fakeCompA_node: could not be started");
                      throw e;
                  }

                  System.out.println("SCA fakeCompA_node started. Test
        usage");
                  SCAClient client = (SCAClient)node;
                  Tmp_double prov_inA =
        client.getService(Tmp_double.class, "FakeComponentA/Tmp_double");
                                if (prov_inA == null){
                      System.err.println("Error: Getted service is
        null!!!!!!!!!!!!!");
                  }
                            // Do some computations
                  System.out.println("test multiple task executions
        for three inputs");                    System.out.println("set
        inA = 50");
prov_inA.set_double(50); /****************/
                  System.out.println("set inA = 100");
prov_inA.set_double(100); System.out.println("set inA void");
                  prov_inA.set_void();
             }
        }

        **************************

        To execute the application, I launch the domain manager,
        Node_compA (it starts normally) and then the client program.
        At the line marked by /****************/ I obtain the
        following trace-error:


        ant runAppl
        Buildfile: build.xml

        runAppl:
           [java] Jul 3, 2008 12:23:03 PM
        org.apache.tuscany.sca.node.launcher.NodeLauncherUtil
        collectJARFiles
           [java] INFO: Runtime classpath: 148 JARs from
        /local/hbouzian/PostDoc/src/sca/tuscany-sca-1.2-incubating/lib
           [java] Jul 3, 2008 12:23:03 PM
        org.apache.tuscany.sca.node.launcher.NodeLauncherUtil
        collectJARFiles
           [java] INFO: Runtime classpath: 93 JARs from
        /local/hbouzian/PostDoc/src/sca/tuscany-sca-1.2-incubating/modules
           [java] Jul 3, 2008 12:23:03 PM
        org.apache.tuscany.sca.node.impl.NodeImpl <init>
           [java] INFO: Creating node:
        http://localhost:9990/node-image/Node_fakeA
           [java] Jul 3, 2008 12:23:04 PM
        org.apache.tuscany.sca.node.impl.NodeImpl configureNode
           [java] INFO: Loading contribution:
        
file:/local/hbouzian/workspace/AseqBAppl/./src/main/resources/node_fakeA/
           [java] Jul 3, 2008 12:23:05 PM
        org.apache.tuscany.sca.node.impl.NodeImpl configureNode
           [java] INFO: Loading composite:
        
http://localhost:9990/composite-resolved/composite:node_fakeA;http://sample;Node_fakeA_comp

           [java] Jul 3, 2008 12:23:05 PM
        org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl$1
        problem
           [java] WARNING: Component reference target not found, it
        might be a remote service: ComponentActrl/ActrlPorts
           [java] Jul 3, 2008 12:23:05 PM
        org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl$1
        problem
           [java] WARNING: Component reference target not found, it
        might be a remote service: ComponentActrl/Tmp_double
           [java] Jul 3, 2008 12:23:05 PM
        org.apache.tuscany.sca.node.impl.NodeImpl start
           [java] INFO: Starting node:
        http://localhost:9990/node-image/Node_fakeA
           [java] Jul 3, 2008 12:23:08 PM
        org.apache.catalina.core.StandardEngine start
           [java] INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.ContextConfig defaultWebConfig
           [java] INFO: No default web.xml
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.DigesterFactory register
           [java] WARNING: Could not get url for
        /javax/servlet/jsp/resources/jsp_2_0.xsd
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.DigesterFactory register
           [java] WARNING: Could not get url for
        /javax/servlet/jsp/resources/jsp_2_1.xsd
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.DigesterFactory register
           [java] WARNING: Could not get url for
        /javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.DigesterFactory register
           [java] WARNING: Could not get url for
        /javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.DigesterFactory register
           [java] WARNING: Could not get url for
        /javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.DigesterFactory register
           [java] WARNING: Could not get url for
        /javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.catalina.startup.DigesterFactory register
           [java] WARNING: Could not get url for
        /javax/servlet/resources/j2ee_web_services_1_1.xsd
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.coyote.http11.Http11Protocol init
           [java] INFO: Initializing Coyote HTTP/1.1 on http-8100
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.coyote.http11.Http11Protocol start
           [java] INFO: Starting Coyote HTTP/1.1 on http-8100
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.tuscany.sca.http.tomcat.TomcatServer addServletMapping
           [java] INFO: Added Servlet mapping:
        http://localhost.localdomain:8100/FakeComponentA/ActrlPorts
           [java] Jul 3, 2008 12:23:09 PM
        org.apache.tuscany.sca.http.tomcat.TomcatServer addServletMapping
           [java] INFO: Added Servlet mapping:
        http://localhost.localdomain:8100/FakeComponentA/Tmp_double
           [java] SCA fakeCompA_node started. Test usage
           [java] test multiple task executions for three inputs
           [java] set inA = 50
           [java] Jul 3, 2008 12:23:09 PM fake_comp.A_fake_Impl <init>
           [java] INFO: An instance of fakeComponentA is created
           [java] Jul 3, 2008 12:23:09 PM fake_comp.A_fake_Impl
        setfakeUseA
           [java] INFO: Wire fakeUseTmpPortA
           [java] Jul 3, 2008 12:23:09 PM fake_comp.A_fake_Impl
        setfakeCtrlA
           [java] INFO: Wire fakeCtrlPortsA
           [java] Jul 3, 2008 12:23:09 PM fake_comp.A_fake_Impl set_double
           [java] INFO: Set an input on component A
           [java] Exception in thread "main"
        org.osoa.sca.ServiceRuntimeException: Target fault type cannot
        be resolved: null
           [java]     at
        
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134)

           [java]     at
        
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)

           [java]     at
        
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)

           [java]     at $Proxy6.set_double(Unknown Source)
           [java]     at
        fake_comp.A_fake_Impl.set_double(A_fake_Impl.java:54)
           [java]     at
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [java]     at
        
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           [java]     at
        
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           [java]     at java.lang.reflect.Method.invoke(Method.java:597)
           [java]     at
        
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109)

           [java]     at
        
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:108)

           [java]     at
        
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)

           [java]     at
        
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:108)

           [java]     at
        
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286)

           [java]     at
        
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)

           [java]     at $Proxy6.set_double(Unknown Source)
           [java]     at
        node.ApplManagerWithFakeComp.main(ApplManagerWithFakeComp.java:78)
           [java] Caused by: org.apache.axis2.AxisFault: Connection
        refused
           [java]     at
        org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
           [java]     at
        
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)

           [java]     at
        org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
           [java]     at
        
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)

           [java]     at
        
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)

           [java]     at
        org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
           [java]     at
        
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)

           [java]     at
        
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)

           [java]     at
        
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
           [java]     at
        
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118)

           [java]     at
        
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)

           [java]     at
        
org.apache.tuscany.sca.binding.sca.axis2.impl.Axis2SCABindingInvoker.invoke(Axis2SCABindingInvoker.java:104)

           [java]     at
        
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)

           [java]     ... 16 more
           [java] Caused by: java.net.ConnectException: Connection refused
           [java]     at java.net.PlainSocketImpl.socketConnect(Native
        Method)
           [java]     at
        java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
           [java]     at
        java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
           [java]     at
        java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
           [java]     at
        java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
           [java]     at java.net.Socket.connect(Socket.java:519)
           [java]     at java.net.Socket.connect(Socket.java:469)
           [java]     at java.net.Socket.<init>(Socket.java:366)
           [java]     at java.net.Socket.<init>(Socket.java:240)
           [java]     at
        
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)

           [java]     at
        
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)

           [java]     at
        
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)

           [java]     at
        
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1321)

           [java]     at
        
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)

           [java]     at
        
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)

           [java]     at
        
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)

           [java]     at
        
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)

           [java]     at
        
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:520)

           [java]     at
        
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)

           [java]     ... 27 more
           [java] Java Result: 1


        The trace on Node_compA is (I use a deamon approach to launch
        nodes):


        03/07/2008 12:22:28 13792 jsvc.exec error: syscall failed in
        set_caps
        03/07/2008 12:22:28 13792 jsvc.exec error: syscall failed in
        set_caps
        Jul 3, 2008 12:22:28 PM node.GenericNode init
        INFO: Node null: in init.
        Jul 3, 2008 12:22:28 PM node.GenericNode start
        INFO: Apache Tuscany SCA Node Node_compA starting...
        Jul 3, 2008 12:22:28 PM
        org.apache.tuscany.sca.node.launcher.NodeLauncherUtil
        collectJARFiles
        INFO: Runtime classpath: 93 JARs from
        /local/hbouzian/PostDoc/src/sca/tuscany-sca-1.2-incubating/modules
        Jul 3, 2008 12:22:28 PM
        org.apache.tuscany.sca.node.launcher.NodeLauncherUtil
        collectJARFiles
        INFO: Runtime classpath: 148 JARs from
        /local/hbouzian/PostDoc/src/sca/tuscany-sca-1.2-incubating/lib
        Jul 3, 2008 12:22:28 PM
        org.apache.tuscany.sca.node.impl.NodeImpl <init>
        INFO: Creating node: http://localhost:9990/node-image/Node_compA
        Jul 3, 2008 12:22:30 PM
        org.apache.tuscany.sca.node.impl.NodeImpl <init>
        INFO: CompositeURL :
        
http://localhost:9990/composite-resolved/composite:node_compA;http://sample;Node_compA_comp
        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        Jul 3, 2008 12:22:30 PM
        org.apache.tuscany.sca.node.impl.NodeImpl configureNode
        INFO: Loading contribution:
        
file:/local/hbouzian/workspace/AseqBAppl/./src/main/resources/node_compA/
        Jul 3, 2008 12:22:32 PM
        org.apache.tuscany.sca.node.impl.NodeImpl configureNode
        INFO: Loading composite:
        
http://localhost:9990/composite-resolved/composite:node_compA;http://sample;Node_compA_comp

        Jul 3, 2008 12:22:32 PM
        org.apache.tuscany.sca.node.impl.NodeImpl start
        INFO: Starting node: http://localhost:9990/node-image/Node_compA
        Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
        Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
        Jul 3, 2008 12:22:35 PM
        org.apache.tuscany.sca.host.webapp.WebAppServletHost
        addServletMapping
        INFO: Added Servlet mapping: /ComponentActrl/Tmp_double
        Jul 3, 2008 12:22:35 PM
        org.apache.tuscany.sca.host.webapp.WebAppServletHost
        addServletMapping
        INFO: Added Servlet mapping: /ComponentActrl/ActrlPorts
        Jul 3, 2008 12:22:35 PM node.GenericNode start
        INFO: SCA Node Node_compA started.


        ********

        in the trace, I expected a log message saying that an instance
        of a ComponentActrl is created when FakeComponentA tries to
        use one of its services. But it doesn't seem to be created!?
        At the same time I don't understand how the wires of
        FakeComponentA references to ComponentActrl services succeed

        [java] Jul 3, 2008 12:23:09 PM fake_comp.A_fake_Impl setfakeUseA
        [java] INFO: Wire fakeUseTmpPortA

        without an errors like component or reference not found.

        Am I wrong somewhere? Let me know if you need any additional
        information (code/xml descriptions).

        Thank you for your help.
        Hinde

Hi Hinde

As a matter of interest what happens if you replace the localhost string with your actual local machine name in your local test?

A useful debugging aid would be to print out the generated composites that both your nodes will run. You can get that by pointing your browser at URI that the nodes use to load their composite, for example,

http://localhost:9990/composite-resolved/composite:node_compA;http://sample;Node_compA_comp

Take a look in there and see if the reference binding uris match the service binding uris

Regards

Simon


Hi Simon,

Thank you for your reply.

The name of my machine is localhost  (returned by hostname command).

The uris matches:

http://localhost:9990/composite-resolved/composite:node_compA;http://sample;Node_compA_comp

<composite targetNamespace="http://sample"; name="Node_compA_comp">
   <component name="ComponentA" uri="ComponentA">
<implementation.java class="a_comp.A_Impl"/>
   <service name="A_Impl">
<interface.java interface="a_comp.A_Impl"/>
<binding.sca name="A_Impl" uri="http://localhost:8200/ComponentA"/>
<callback/>
</service>
</component>
   <component name="ComponentActrl" uri="ComponentActrl">
<implementation.java class="a_comp.A_ctrl"/>
   <service name="Tmp_double">
<interface.java interface="aSEQb.Tmp_double"/>
<binding.sca name="Tmp_double" uri="http://localhost:8200/ComponentActrl/Tmp_double"/>
<callback/>
</service>
   <service name="ActrlPorts">
<interface.java interface="a_comp.ActrlPorts"/>
<binding.sca name="ActrlPorts" uri="http://localhost:8200/ComponentActrl/ActrlPorts"/>
<callback/>
</service>
   <reference name="userAtask" target="ComponentA">
<interface.java interface="a_comp.AtaskInterface"/>
<binding.sca name="userAtask#ComponentA/A_Impl" uri="http://localhost:8200/ComponentA"/>
<callback/>
</reference>
</component>
</composite>

http://localhost:9990/composite-resolved/composite:node_fakeA;http://sample;Node_fakeA_comp

<composite targetNamespace="http://sample"; name="Node_fakeA_comp">
   <component name="FakeComponentA" uri="FakeComponentA">
<implementation.java class="fake_comp.A_fake_Impl"/>
   <service name="Tmp_double">
<interface.java interface="aSEQb.Tmp_double"/>
<binding.sca name="Tmp_double" uri="http://localhost:8100/FakeComponentA/Tmp_double"/>
<callback/>
</service>
   <service name="ActrlPorts">
<interface.java interface="a_comp.ActrlPorts"/>
<binding.sca name="ActrlPorts" uri="http://localhost:8100/FakeComponentA/ActrlPorts"/>
<callback/>
</service>
   <reference name="fakeUseA" target="ComponentActrl/Tmp_double">
<interface.java interface="aSEQb.Tmp_double"/>
<binding.sca name="fakeUseA#ComponentActrl/Tmp_double" uri="http://localhost:8200/ComponentActrl/Tmp_double"/>
<callback/>
</reference>
   <reference name="fakeCtrlA" target="ComponentActrl/ActrlPorts">
<interface.java interface="a_comp.ActrlPorts"/>
<binding.sca name="fakeCtrlA#ComponentActrl/ActrlPorts" uri="http://localhost:8200/ComponentActrl/ActrlPorts"/>
<callback/>
</reference>
</component>
</composite>

I'm used to do locally tests distributed examples (calculator-distributed and own simple examples without problems (with "localhost" as the name of the machine).

So, I just tried on another single machine (on a cluster) and no problem occurred. Is that can mean the name "localhost"can cause problems? but why in this case and not others?

Thanks,
regards
Hinde









Reply via email to