Duplicate :
|
Name: gm110360 Date: 04/18/2002 FULL PRODUCT VERSION : java version "1.4.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92) Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode) FULL OPERATING SYSTEM VERSION : Microsoft Windows 2000 [Version 5.00.2195] A DESCRIPTION OF THE PROBLEM : I?m parsing xml files (method parse(File f, HandlerBase hb) in class SAXParser). With a JFileChooser i am choosing the files which i want to parse. When i?m choosing files with absolute paths (e.g. L:/dummy.xml), the parsing went perfect. When i?m choosing files with relative paths (e.g. //10.50.40.118/develop/dummy.xml, where //10.50.40.118/develop is a server within a local network connected as L: in my system), i get a ConnectionException (java.net.ConnectionException: Connection refused: connect). I also tried to define the server in the hosts file, but without success. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Create a file object with relative path to an xml file on a server in a local network 2. Try to parse the xml file EXPECTED VERSUS ACTUAL BEHAVIOR : After calling the parse(File f, HandlerBase hb) method in Class SAXParser, a ConnectionException (java.net.ConnectionException: Connection refused: connect) will appear. ERROR MESSAGES/STACK TRACES THAT OCCUR : java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:296) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:162) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:149) at java.net.Socket.connect(Socket.java:430) at java.net.Socket.connect(Socket.java:379) at sun.net.NetworkClient.doConnect(NetworkClient.java:142) at sun.net.NetworkClient.openServer(NetworkClient.java:121) at sun.net.ftp.FtpClient.openServer(FtpClient.java:390) at sun.net.ftp.FtpClient.<init>(FtpClient.java:654) at sun.net.www.protocol.ftp.FtpURLConnection.connect (FtpURLConnection.java:178) at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream (FtpURLConnection.java:260) at java.net.URL.openStream(URL.java:956) This bug can be reproduced always. ---------- BEGIN SOURCE ---------- //Server "\\10.50.40.118\develop" connected as L: File correctFile = new File("L:\dummy.xml"); File wrongFile = new File("\\10.50.40.118\develop\dummy.xml"); DefaultHandler handler = new MyHandler(); SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); saxParser.parse(correctFile, handler); //File will be parsed correct. saxParser.parse(wrongFile, handler); //Exception will appear. ---------- END SOURCE ---------- (Review ID: 145576) ======================================================================