[jdom-interest] Unable to load a valid xml document
kgoss at interactcommerce.com
kgoss at interactcommerce.com
Fri Dec 15 13:11:43 PST 2000
I recently downloaded the JDOM source and sucessfully built the JAR files as
described in the ReadMe. Following this, I downloaded and referenced the
Xerces.jar file from apache.org. Although everything compiles fine, I'm
unable to sucessfully load a document.
I continue to get the following error:
main (11:41:34): Exception raised:
"java.lang.ArrayIndexOutOfBoundsException: 8"
main (11:41:34): You may press F5 to continue with default exception
handling)
VisualCafe (11:41:34): Warning:
org\apache\xerces\utils\SymbolCache.java(201): Source File not found
I have referenced both the JDOM and Xerces JAR files... but no luck.
My code is as follows... and the File object does return true to its
exists() method... any help is appreciated, thanks
Kris
________________________________
public static void main(String[] args) {
ScreenFlowXMLDAO test = new
ScreenFlowXMLDAO("D;framework;webpages;xml");
}
/**
* Default constructor that loads XML files from the specified file path
*/
public ScreenFlowXMLDAO(String resourcesFilePath) {
// this builds the documents using SAX and Xerces, no validation
try {
DOMBuilder builder = new DOMBuilder();
File f = new File("requestmappings.xml");
System.out.println(f.exists());
// load the xml documents
Document maps = builder.build(new
File("requestmappings.xml"));
Document screens = builder.build(new
File("screendefinitions.xml"));
// "objectify" the xml now into hashmaps
loadRequestMappings(maps.getRootElement());
loadScreenDefinitions(screens.getRootElement());
}
catch (JDOMException e) {
if (e.getRootCause() != null) {
e.getRootCause().printStackTrace();
}
else {
e.printStackTrace();
}
}
catch (Exception e) {
Debug.print(e);
}
}
More information about the jdom-interest
mailing list