import.sdo element is not resolved if it follows a property element
-------------------------------------------------------------------

                 Key: TUSCANY-1949
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1949
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Assembly Model
    Affects Versions: Java-SCA-1.0
            Reporter: Greg Dritschler
            Priority: Minor


I have an SCA composite that uses both a property element and an import.sdo 
element.  If the property element appears before the import.sdo element as 
shown below, then the application fails during execution when it tries to 
create an SDO.

 <composite ...
   <component ...
     <property name="p" type="xsd:string">XYZZY</property>
   </component>
   <dbsdo:import.sdo .../>
 </composite>

If I reorder the elements as shown below then the application works.

 <composite ...
   <dbsdo:import.sdo .../>
   <component ...
     <property name="p" type="xsd:string">XYZZY</property>
   </component>
 </composite>

I found the problem in CompositeProcessor.  When a property element is found, 
it calls a method readPropertyValue.  This method consumes the property end 
element so CompositeProcessor won't see it.  Since CompositeProcessor does not 
see the property end element, it does not clear the "property" method variable. 
 Then when it processes the import.sdo element, it sees the "property" variable 
is non-null and mistakenly associates the import.sdo extension with the 
property instead of with the composite.

I was able to work around the problem by clearing the property variable after 
the readPropertyValue call as shown below.  (There are actually two such calls, 
one for component level and one for composite level, and I cleared it in both 
cases.)

                            // Read the property value
                            Document value = 
readPropertyValue(property.getXSDElement(), property.getXSDType(), reader);
                            property.setValue(value);
                            
                            composite.getProperties().add(property);
                            property = null; // **WORKAROUND**

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to