Tuscany
  1. Tuscany
  2. TUSCANY-1560

A component with multiple services does not work.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Java-SCA-1.x
    • Fix Version/s: Java-SCA-0.99
    • Component/s: SCA Java Runtime
    • Labels:
      None
    • Environment:
      windows

      Description

      In code org.apache.tuscany.sca.core.component.ComponentContextImpl, at line 130 :
      if (regularServices.size() != 1)

      { throw new ServiceRuntimeException("The component doesn't have exactly one service"); }

      multiple services per component will be failed by above checking.

        Activity

        Hide
        Jean-Sebastien Delfino added a comment -

        This now works as described in the spec:

        • if you have one service on your component you can target it with "componentName"
        • if you have multiple services on your component you need to write "componentName/serviceName"

        I just tested this and I'm getting correct error messages now:
        More than one service is declared on component CalculatorServiceComponent. Service name is required to get the service.

        Show
        Jean-Sebastien Delfino added a comment - This now works as described in the spec: if you have one service on your component you can target it with "componentName" if you have multiple services on your component you need to write "componentName/serviceName" I just tested this and I'm getting correct error messages now: More than one service is declared on component CalculatorServiceComponent. Service name is required to get the service.
        Hide
        Raymond Feng added a comment -

        I improved the text message for the exception to differentiate the 1st and 2nd cases under r569057. Hope it will help.

        Thanks,
        Raymond

        Show
        Raymond Feng added a comment - I improved the text message for the exception to differentiate the 1st and 2nd cases under r569057. Hope it will help. Thanks, Raymond
        Hide
        Raymond Feng added a comment -

        Please verify if you hit the 2nd case. If so, it's a test case issue and you need to pass the service name for the getService() as suggested by Florian,

        Thanks,
        Raymond

        Show
        Raymond Feng added a comment - Please verify if you hit the 2nd case. If so, it's a test case issue and you need to pass the service name for the getService() as suggested by Florian, Thanks, Raymond
        Hide
        Florian Rosenberg added a comment -

        I had the same issue as stated above. The first one was a warning as shown below:

        --------------------------------------------------------------
        Aug 22, 2007 12:17:38 PM
        org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl$1 problem
        WARNING: [WARNING] No implementation for component: FeedAggregatorComponent
        null
        --------------------------------------------------------------

        The error was in definition of the org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor file. The contents of this file is shown below:
        com.ibm.sca.implementation.splice.SpliceArtifactProcessor;type=http://www.osoa.org/xmlns/sca/1.0#implementation.splice,model=com.ibm.sca.implementation.splice.SpliceImplementation

        but actually the "type=" is now "qname=".

        The second exception (show below) can be either a result of the warning above or a change in the runtime behavior as state by Luciano on the mailing list.
        So if you have a getService("ABC") in your client you need to make sure that the target component has only one service, otherwise you should use getService("ABC/ServiceName").

        --------------------------------------------------------------
        Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The component doesn't have exactly one service
        at
        org.apache.tuscany.sca.core.component.ComponentContextImpl.createSelfReference(ComponentContextImpl.java:135)
        at
        org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getServiceReference(DefaultSCADomain.java:377)
        at
        org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getService(DefaultSCADomain.java:321)
        at com.ibm.sca.implementation.splice.SpliceScaTester.main(SpliceScaTester.java:17)
        --------------------------------------------------------------

        Show
        Florian Rosenberg added a comment - I had the same issue as stated above. The first one was a warning as shown below: -------------------------------------------------------------- Aug 22, 2007 12:17:38 PM org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl$1 problem WARNING: [WARNING] No implementation for component: FeedAggregatorComponent null -------------------------------------------------------------- The error was in definition of the org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor file. The contents of this file is shown below: com.ibm.sca.implementation.splice.SpliceArtifactProcessor;type= http://www.osoa.org/xmlns/sca/1.0#implementation.splice,model=com.ibm.sca.implementation.splice.SpliceImplementation but actually the "type=" is now "qname=". The second exception (show below) can be either a result of the warning above or a change in the runtime behavior as state by Luciano on the mailing list. So if you have a getService("ABC") in your client you need to make sure that the target component has only one service, otherwise you should use getService("ABC/ServiceName"). -------------------------------------------------------------- Exception in thread "main" org.osoa.sca.ServiceRuntimeException: The component doesn't have exactly one service at org.apache.tuscany.sca.core.component.ComponentContextImpl.createSelfReference(ComponentContextImpl.java:135) at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getServiceReference(DefaultSCADomain.java:377) at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getService(DefaultSCADomain.java:321) at com.ibm.sca.implementation.splice.SpliceScaTester.main(SpliceScaTester.java:17) --------------------------------------------------------------

          People

          • Assignee:
            Raymond Feng
            Reporter:
            Zhenghui Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development