Bug #4968
closedCould not validate generated KAR file for uploading to repository
0%
Description
I created a KAR file by doing the following:
1) Instantiate: * An SDF director (iterations=1) * A StringConstant (value="Hello world!") * A Display
2) Connect the StringConstant to the Display
3) Create a new report containing Display.input.
4) Attempt to save to a repository.
The following exception is produced:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'KAR-Version'. One of '{lsid}' is expected.
Files
Updated by Jing Tao over 14 years ago
The xml looks like:
<mainAttributes>
<KAR-Version>2.0</KAR-Version>
<Manifest-Version>1.4.2</Manifest-Version>
<module-dependencies>provenance;core;reporting</module-dependencies>
<lsid>urn:lsid:kepler-project.org/ns/:882:14:1</lsid>
</mainAttributes>
However, the schema looks like:
<xs:complexType name="mainAttributesType">
<xs:sequence>
<xs:element name ="lsid" />
<xs:element name ="module-dependencies" minOccurs="0" />
<xs:element name ="KAR-Version" />
<xs:element name ="Manifest-Version" />
</xs:sequence>
</xs:complexType>
The order doesn't match
Updated by Jing Tao over 14 years ago
During the generating the children elements of mainAttribute, kepler iterated a Set object to get names and values. However, Set objects couldn't keep order. So it may create an invalid document.
Now we change to use an ordered key list to get the names and values. The order will be persistent and any invalid document would not be generated.
I used the procedure on comment 1 and got an valid document.
I also tried upload some another kar files, it worked as well.
Sean, would you please test it again? If it works, would you please close the bug? Thanks.
Updated by Jing Tao over 14 years ago
Close it. If Sean finds an issue on his testing, this bug will be reopened.