[jdom-interest] File lockup with invalid did

Laurent Bihanic laurent.bihanic at atosorigin.com
Thu Mar 27 01:45:10 PST 2003


I've just checked SAXBuilder code and it looks OK. So, I suspect this is a 
parser bug. SAXBuilder.build(File) just translates the file name into a URL 
and calls build(URL) which in turn passes the URL to the parser. Hence, it's 
the parser that actually opens the file and is responsible for closing it.

Which parser and which version are you using ? Maybe a parser upgrade may 
would fix the problem.

Laurent

Jason Long wrote:
> I am using the following to read files.
> 
>   public Document getJDOMFromFile(File file)
>       throws JDOMException,
>       NullPointerException, IOException {
>     Document docJDOM = null;
>     try {
>       SAXBuilder builder = new SAXBuilder();
>       docJDOM = builder.build(file);
>     }
>     catch (JDOMException e) {
>       e.printStackTrace();
>       throw new JDOMException("Broken JDOM", e);
>     }
>     catch (NullPointerException e) {
>       e.printStackTrace();
>       throw new NullPointerException("Broken JDOM");
>     }
>     return docJDOM;
>   }
> 
> The client needs to edit the dtd, and send it by ftp.
> The only thing defined in the dtd entities.
> When an entity is not defined an error is throw, but the file is then
> locked.
> How can I read in a file and release it if there are errors?
> 
> 
> Jason Long - CEO and Chief Software Engineer
> Supernova Software - supernovasoftware.com
> BS Physics, MS  Chemical Engineering




More information about the jdom-interest mailing list