Bug #4968
closed
Could not validate generated KAR file for uploading to repository
Added by Sean Riddle over 14 years ago.
Updated over 14 years ago.
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
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
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.
Close it. If Sean finds an issue on his testing, this bug will be reopened.
Original Bugzilla ID was 4968
Also available in: Atom
PDF