John wrote:
> Hi Nicolas,
> I wonder if you could answer a problem I am having
> processing an XML file with a Java application. The
> XML file is ejb-jar.xml. There is a line referencing a
> DTD e.g.
> "http://java.sun.com/dtd/ejb-jar_2_1.dtd">.
> However, when my internet connection or java.sun.com
> is down, I am unable to retrieve the dtd and thus get
> a FileNotFoundException. I have tried saving the dtd
> in the java classpath with no success. The error
> occurs when I call: builder.parse(new
> File("ejb-jar.xml"));
>
> Any suggestions or comments would be appreciated.
> thanks.../john
Hi, John!
The trouble is that the parser is trying to retrieve the file
from http://java.sun.com/dtd/ejb-jar_2_1.dtd. You can solve
this problem by saving a local copy to the same directory as
the XML file and changing the DOCTYPE declaration to read
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"ejb-jar_2_1.dtd">
I hope that helps!
---- Nick
Comments