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

Multiple xmlns="" generated when writing out composite file for parameters with multiple attribures

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Java-SCA-2.0-Beta1
    • Java-SCA-2.0-Beta2
    • None
    • None
    • Sun JDK 1.6-20 no wookstox

    Description

      I'm trying to run ASM_4005 using the JVM XML processing, i.e. no Woodstox. I get the following error

      SEVERE: XMLStreamException occured due to :

      {0}

      org.apache.tuscany.sca.contribution.processor.ContributionReadException: javax.xml.stream.XMLStreamException: ParseError
      at [row,col]:[5,227]
      Message: Attribute "xmlns" was already specified for element "zdef940251576:value".

      The policy processing writes out the composite so it can be read back into a DOM to have XQuery applied. It's on the read that the error occurs. The XML that gets written is as follows....

      <zdef-767159874:composite xmlns=""
      xmlns:zdef-767159874="http://docs.oasis-open.org/ns/opencsa/sca/200912"
      targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
      name="" local="true">
      <zdef-767159874:component xmlns="" name="TestClient"
      uri="TestClient">
      <zdef-767159874:implementation.composite
      xmlns="" xmlns:ns0="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
      name="ns0:TestClient_0002"></zdef-767159874:implementation.composite>
      <zdef-767159874:service xmlns="" name="TestInvocation">
      <zdef-767159874:interface.wsdl
      interface="http://test.sca.oasisopen.org/#wsdl.interface(TestInvocation)"></zdef-767159874:interface.wsdl>
      <zdef-767159874:binding.ws name="TestInvocation"></zdef-767159874:binding.ws>
      </zdef-767159874:service>
      <zdef-767159874:reference xmlns="" name="reference1"
      target="TestComponent1/Service1"></zdef-767159874:reference>
      <zdef-767159874:property xmlns="" name="testName"
      mustSupply="false" many="false">
      <value xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912">ASM_4005</value>
      </zdef-767159874:property>
      </zdef-767159874:component>
      <zdef-767159874:component xmlns=""
      name="TestComponent1" uri="TestComponent1">
      <zdef-767159874:implementation.composite
      xmlns="" xmlns:ns1="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
      name="ns1:TestComposite43"></zdef-767159874:implementation.composite>
      <zdef-767159874:reference xmlns="" name="Reference1"
      target="TestComponent2/Service1"></zdef-767159874:reference>
      <zdef-767159874:property xmlns="" name="serviceName"
      mustSupply="false" many="false">
      <value xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912">service1</value>
      </zdef-767159874:property>
      <zdef-767159874:property xmlns="" name="propertyName"
      mustSupply="false" many="false" type="Callback">

        • <zdef-767159874:value xmlns="" xmlns=""
        • policySets="bar" requires="foo">
          <binding.sca xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"></binding.sca>
          </zdef-767159874:value>
          </zdef-767159874:property>
          </zdef-767159874:component>
          <zdef-767159874:component xmlns=""
          name="TestComponent2" uri="TestComponent2">
          <zdef-767159874:implementation.composite
          xmlns="" xmlns:ns2="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
          name="ns2:TestComposite1"></zdef-767159874:implementation.composite>
          <zdef-767159874:service xmlns="" name="Service1"></zdef-767159874:service>
          <zdef-767159874:property xmlns="" name="serviceName"
          mustSupply="false" many="false">
          <value xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912">service2</value>
          </zdef-767159874:property>
          </zdef-767159874:component>
          </zdef-767159874:composite>

      Note that the lines marked ** does have xmlns="" xmlns="" which is what's causing the reader to fail.

      Having looked at this there is some rather strange code in the org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.XAttr nested class. If no namespace URI is provided when writing an attribute then null is chosen.

      public XAttr(String name, String value)

      { this(null, name, value); }

      This is despite the class defaulting the uri meber variable to SCA11_NS

      Anyone know why this is defaulted to null?

      Attachments

        Activity

          People

            simonslaws Simon Laws
            simonslaws Simon Laws
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: