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

itest-implementation-spring fails due to duplicate services

    XMLWordPrintableJSON

Details

    Description

      org.oasisopen.sca.ServiceRuntimeException: org.oasisopen.sca.ServiceRuntimeException: Duplicate service name: Component = HelloWorldComponent Service = HelloWorld
      at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:204)
      at org.apache.tuscany.sca.node.impl.NodeFactoryImpl.createNode(NodeFactoryImpl.java:51)
      at org.apache.tuscany.sca.itest.spring.AbstractSCATestCase.setUp(AbstractSCATestCase.java:38)
      at junit.framework.TestCase.runBare(TestCase.java:132)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: org.oasisopen.sca.ServiceRuntimeException: Duplicate service name: Component = HelloWorldComponent Service = HelloWorld
      at org.apache.tuscany.sca.node.impl.NodeImpl.analyzeProblems(NodeImpl.java:746)
      at org.apache.tuscany.sca.node.impl.NodeImpl.configureNode(NodeImpl.java:500)
      at org.apache.tuscany.sca.node.impl.NodeImpl.<init>(NodeImpl.java:201)
      ... 16 more

      I investigated the issue. Here is the root cause:

      src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml defined two Spring beans that implement the same remotable java interface HelloWorld. After the java introspection, we end up
      with two services with the same name "HelloWorld" in the componentType that represents the spring context.

      Attachments

        Activity

          People

            ramkumar.rj Ramkumar Ramalingam
            rfeng Zhaohui Feng
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: