[jdom-interest] Using SAXBuilder offline

Matthew Lavy mml at mupsych.org
Fri Aug 23 01:16:38 PDT 2002


I'm having a bit of a JDOM emergency, and wondered if anyone knew the 

I am using JDOM to parse a program's XML configuration file. The 
configuration file is in the Java Servlet web.xml format (including relevant 
DOCTYPE definition). The reason for this is that I am using the same web.xml 
file to configure a servlet as an application. In servlet land, tomcat gets 
on with the business of reading the XML file; in application land, I am 
doing it myself, with the aid of the code fragment below: 

SAXBuilder parser = new SAXBuilder();
Document doc = parser.build(filename); 

On my test machine at home this works beautifully. However, on the machine 
on which my application has to run I have a problem: parser.build() hangs 
for ages and then times out! Further investigation reveals that something is 
trying to connect to the java.sun.com website (presumably in response to the 
DOCTYPE). This is not great, because the machine I am running on doesn't 
have a network connection!! 

I would be very grateful if anyone could give advice on how to prevent JDOM 
or its dependencies from trying to make outbound network connections when 
parsing an XML file. 

Many thanks in advance. 


Matthew M Lavy MA PhD ARCM LTCL
Tel: 01223 511338 

More information about the jdom-interest mailing list