Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-3558

Issues found when using two nodes instead of one node to bootstrap composite

    XMLWordPrintableJSON

Details

    Description

      I revised the sample-store to only config binding.sca. I have two contribution jars: one is store client , which uses client.Shopper and client.ShoperImpl classes, and the contribution import services package; the other is store , which contains all the classes under services, and the contribution export services package.

      I noticed different behaviors if I bootstrap composite in different Node topologies.

      Case 1: when using one node to bootstrap the two contributions, the test case ( ClientSCAFactory ) works

      String storeLocation = "File:///C:/ASV/Tuscany2x/Test/TestCase/sample-store.jar";
      String storeClientLocation = "File:///C:/ASV/Tuscany2x/Test/TestCase/sample-store-client.jar";

      node1 = NodeFactory.newInstance().createNode(new Contribution("store",storeLocation), new Contribution("storeClient", storeClientLocation));

      node1.start();

      Case 2: when using tow nodes to bootstrap the two contributions, the same tese case fails:

      String storeLocation = "File:///C:/ASV/Tuscany2x/Test/TestCase/sample-store.jar";
      String storeClientLocation = "File:///C:/ASV/Tuscany2x/Test/TestCase/sample-store-client.jar";

      node1 = NodeFactory.newInstance().createNode(new Contribution("store",storeLocation));
      node1.start();
      node2 = NodeFactory.newInstance().createNode(new Contribution("storeClient", storeClientLocation));
      node2.start();

      May 17, 2010 9:44:43 PM org.apache.tuscany.sca.node.impl.NodeImpl start
      INFO: Starting node: http://tuscany.apache.org/sca/1.1/nodes/default0 domain: default
      May 17, 2010 9:44:43 PM org.apache.tuscany.sca.node.impl.NodeFactoryImpl loadContributions
      INFO: Loading contribution: file:/C:/ASV/Tuscany2x/Test/TestCase/sample-store.jar
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistryImpl addEndpoint
      INFO: Add endpoint - (@1341018094)Endpoint: URI = Catalog#service-binding(Catalog/Catalog)
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistryImpl addEndpoint
      INFO: Add endpoint - (@1360810268)Endpoint: URI = ShoppingCart#service-binding(Cart/Cart)
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistryImpl addEndpoint
      INFO: Add endpoint - (@1378767406)Endpoint: URI = ShoppingCart#service-binding(Total/Total)
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistryImpl addEndpoint
      INFO: Add endpoint - (@1399280487)Endpoint: URI = CurrencyConverter#service-binding(CurrencyConverter/CurrencyConverter)
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.node.impl.NodeImpl start
      INFO: Starting node: http://tuscany.apache.org/sca/1.1/nodes/default1 domain: default
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.node.impl.NodeFactoryImpl loadContributions
      INFO: Loading contribution: file:/C:/ASV/Tuscany2x/Test/TestCase/sample-store-client.jar
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.deployment.DefaultDeployer [Contribution: file:/C:/ASV/Tuscany2x/Test/TestCase/sample-store-client.jar] (UnresolvedImport)
      SEVERE: Unresolved import: Import = services
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
      INFO: Stopping node: http://tuscany.apache.org/sca/1.1/nodes/default0
      May 17, 2010 9:44:45 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
      INFO: Stopping node: http://tuscany.apache.org/sca/1.1/nodes/default1

      Case 3: When I merge the two contribution into one and bootstrap each composite in its own node, I got the following exception:

      String storeLocation = "File:///C:/ASV/Tuscany2x/Test/TestCase/sample-store-all.jar";
      node1 = NodeFactory.newInstance().createNode("store.composite",new Contribution("store",storeLocation));
      node1.start();
      node2 = NodeFactory.newInstance().createNode("store-client.composite",new Contribution("store",storeLocation));
      node2.start();

      org.oasisopen.sca.ServiceRuntimeException: Unable to bind [] - No endpoints found in the domain that match the reference (@387520281)EndpointReference: URI = StoreClient#reference(catalog) WIRED_TARGET_NOT_FOUND Target = (@409344102)Endpoint: URI = Catalog [Unresolved]
      at org.apache.tuscany.sca.core.runtime.impl.EndpointReferenceBinderImpl.bind(EndpointReferenceBinderImpl.java:251)
      at org.apache.tuscany.sca.core.runtime.impl.EndpointReferenceBinderImpl.bindRunTime(EndpointReferenceBinderImpl.java:114)
      at org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointReferenceImpl.resolveEndpointReference(RuntimeEndpointReferenceImpl.java:305)
      at org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointReferenceImpl.initInvocationChains(RuntimeEndpointReferenceImpl.java:255)
      at org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointReferenceImpl.getInvocationChains(RuntimeEndpointReferenceImpl.java:176)
      at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.getInvocationChain(JDKInvocationHandler.java:195)
      at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:99)
      at $Proxy27.get(Unknown Source)
      at client.ShopperImpl.shop(ShopperImpl.java:43)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:600)
      at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:113)
      at org.apache.tuscany.sca.binding.sca.provider.SCABindingInvoker.invoke(SCABindingInvoker.java:75)
      at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:236)
      at org.apache.tuscany.sca.core.invocation.impl.JDKInvocationHandler.invoke(JDKInvocationHandler.java:106)
      at $Proxy24.shop(Unknown Source)
      at store.StoreTestCase_Merged_TwoNode.testShop(StoreTestCase_Merged_TwoNode.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:600)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

      I think this behavior differences are not following Spec, where what matters is the SCA Domain , not how we bootstrapping using Node( IMO, an implementation detail). Thanks for looking into the issues.

      Attachments

        1. sample-store.jar
          13 kB
          Yang Lei
        2. sample-store-client.jar
          5 kB
          Yang Lei
        3. sample-store-all.jar
          15 kB
          Yang Lei

        Activity

          People

            Unassigned Unassigned
            yanglei99 Yang Lei
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: