Having java.net.UnknownHostException in using DOM

Hello Guys,

I am trying to read an XML file using DOM. Everything works except for an exception thrown if I uncomment the portion of my XML file that specifies the doctype, like this...

<!DOCTYPE struts-config PUBLIC

"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"

"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

the exception thrown is such

IOException: jakarta.apache.org

java.net.UnknownHostException: jakarta.apache.org

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)

at java.net.Socket.connect(Socket.java:507)

at java.net.Socket.connect(Socket.java:457)

at sun.net.NetworkClient.doConnect(NetworkClient.java:157)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)

at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)

at sun.net.www.http.HttpClient.New(HttpClient.java:287)

.

.

.

When I comment this section my application works fine. But on uncomment it, I get the exception.

Please what do I do.

Michael

[1235 byte] By [okmicha] at [2007-11-27 5:23:01]
# 1
I just discovered that the problem does not occur with DOM alone. I tried SAX out and got the same error. Can anyone tell me what's up with my XML or my java code.Michael
okmicha at 2007-7-12 11:48:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

> Can anyone tell me what's up with my XML or my java code.

There's nothing in either of those things that has anything to do with the error. Which is that the parser can't connect to http://jakarta.apache.org to download that DTD. And the probable reason for that is that you don't have an unrestricted Internet connection. Perhaps there's a proxy server or a firewall or something blocking that connection. Ask your network people if you don't understand any of that.

DrClapa at 2007-7-12 11:48:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...