Ticket #240 (closed defect: fixed)
Scenario open throws filenotfound exception for missing external DTD
| Reported by: | jdalbey | Owned by: | jdalbey |
|---|---|---|---|
| Priority: | Medium | Milestone: | |
| Component: | ScriptBuilder Model | Version: | |
| Severity: | Minor | Keywords: | |
| Cc: |
Description
If an xml file being opened refers to an external DTD file that isn't present, parsing the xml will crash with a filenotfound exception.
This happens when a new Scenario is saved because currently we don't write the external DTD file, we just place the link in the xml. It's up to the user to manually copy the correct DTD file into the same folder as the saved Scenario.
If that saved Scenario is then opened, the exception is thrown.
In previous revisions an embedded DTD was used, which avoids this problem, but is much less flexible because the DTD is hard-coded within the ScriptBuilder.
One option is to bundle a DTD file with ScriptBuilder zip, but that isn't ideal because that file might get out of sync with the reference DTD in Sim Mgr.
For now, let's just display an error dialog and direct the user to supply the needed external DTD before opening the xml file.

Added helpful error dialog to loadScriptFromFile() in SimulationScript.java. Fixed in r207.