[jdom-interest] SAXBuilder and java.net.URL

Marisa DeMeglio marisa at dinf.ne.jp
Mon May 27 01:22:12 PDT 2002


Hi,

I am new to the list, and new to Java and JDOM.   So far everything has 
worked very well, but I am having trouble with SAXBuilder when I try to use 
it with a java.net.url, that points to a file on my hard drive.
Here are a few lines of code ...

------------------
SAXBuilder sbuild = new SAXBuilder(false);

//create a new URL, pointing to a file that exists
java.net.URL amisxmlURL = new 
java.net.URL("file://e:/dev/AMIS/Java/config/amis.xml");

//amisxmlURL.toString() is "file://e:/dev/AMIS/Java/config/amis.xml"
Document xDoc = sbuild.build(amisxmlURL.toString());  //also I have tried 
using just amisxmlURL as the parameter


Debugger tells me: Hit uncaught exception org.jdom.JDOMException
Bottom status bar of JBuilder6 says: Cannot locate SAXBuilder.java from 
project source/class path

----however, when I do this:

Document xDoc = sbuild.build("file:////e://dev//AMIS//Java//config//amis.xml");

I have no problems.  The correct document is returned.   If I try to build 
a URL with "//" instead of "/", I get a Malformed URL exception.
I hope this falls under the scope of this group; my apologies if not.  Any 
advice would be greatly appreciated.

Thank you,

Marisa

------------------------------------------
Marisa DeMeglio
marisa at dinf.ne.jp
IT Development
Information Center/JSRPD
www.dinf.org
------------------------------------------





More information about the jdom-interest mailing list