| Author |
Connection Refused exception upon reading/parsing a shortcut file present in network drive
|
Piyush Mattoo
Ranch Hand
Joined: Mar 12, 2007
Posts: 30
|
|
Here mart.xml is a shortcut present in C:\Param\Bin on a windows box. I get the following IOException:
Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:524)
at java.net.Socket.connect(Socket.java:474)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.NetworkClient.openServer(NetworkClient.java:118)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:488)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:475)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:270)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:352)
at JDOMElementTextContent.parseXml(JDOMElementTextContent.java:36)
at JDOMElementTextContent.main(JDOMElementTextContent.java:47)
I tried to open Stream from URL using file: protocol but URLConnection.getInputStream throws the same connection refused exception.
Any recommendations would be appreciated?
|
SCWCD-1.4, SCJP-1.4, CSM.
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2926
|
|
The Path provided in the File constructor is not correct. You can either specify an absolute path or specify a relative path.
Update: I assumed that the program and the file which it tries to access are on the same machine.
Wrong interpretation, didn't notice the Network Drive in the Subject Please dont consider this.
|
Mohamed Sanaulla | My Blog
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Do you have access to that share and file? Does the user running the JVM have access (in case that isn't you)?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Connection Refused exception upon reading/parsing a shortcut file present in network drive
|
|
|