I am facing this weird issue while opening hbm file. I am using hibernate3.jar. I also verified that there is only one hibernate3.jar in classpath and it contains hibernate mapping dtd file.
Code:
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setValidating(false);
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
return docBuilder.parse(filePath);
Exception:[java] Caused by: java.net.ConnectException: Connection timed out: connect
[java] at java.net.PlainSocketImpl.socketConnect(Native Method)
[java] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
[java] at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
[java] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
[java] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
[java] at java.net.Socket.connect(Socket.java:529)
[java] at java.net.Socket.connect(Socket.java:478)
[java] at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
[java] at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
[java] at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
[java] at sun.net.www.http.HttpClient.<init>(HttpClient.java:227)
[java] at sun.net.www.http.HttpClient.New(HttpClient.java:300)
[java] at sun.net.www.http.HttpClient.New(HttpClient.java:317)
[java] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
[java] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
[java] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
[java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
[java] at java.net.URL.openStream(URL.java:1010)
[java] at org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFactory.java:149)
[java] at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntity(DefaultEntityHandler.java:772)
[java] at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalSubset(DefaultEntityHandler.java:571)
[java] at org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java:1139)
[java] at org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentScanner.java:2145)
[java] at org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentScanner.java:2100)
[java] at org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(XMLDocumentScanner.java:831)
[java] at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
[java] at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
[java] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:195)
[java] at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
I also tried by specifying docBuilder.setEntityResolver(new DTDEntityResolver());
Any pointers will be appreciated.
Thanks,
Leo