Hi i am using JDom to parse an xml file. But i am getting exception as following:
org.jdom.JDOMException: Error in building: Connection timed out: connect at org.jdom.input.SAXBuilder.build(SAXBuilder.java:306) at org.jdom.input.SAXBuilder.build(SAXBuilder.java:583)
I am developing a web site and i am using following code:
Hi, Thanks for your reply. I am actually trying to parse the Web.xml file and it has the urls that cannot be accessed from my system. So is there any solution for this?
I suppose you're talking about the URLs in the DOCTYPE declaration? If that's the case, you should be able to get rid of the exception by calling setValidating(false) on the DocumentBuilderFactory you're getting your parser from (or SAXParserFactory if you're using SAX instead of DOM).
That's the only way I can think of. Then again, you could always run the document through a filtering class which removes the DOCTYPE declaration from the stream if it finds one.