hi.
i have a program working on windows but when i copy it over to unix and compile it there and run it it gives me this error:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:282)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:124)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:111)
at java.net.Socket.<init>(Socket.java:221)
at java.net.Socket.<init>(Socket.java:89)
at sun.net.NetworkClient.doConnect(NetworkClient.java:54)
at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at lookup.main(lookup.java:30)
the unix machine is connected to the net !
its just a simple program that creates a URL object.
gets a URLConnection from this. gets an inputstream
from and an output stream. and runs
the cgi program on dictionary.com for looking up words.
anyone any idea where the error is coming from ?
in case im being vague ... heres a smidgeon of my
code.
URL url = new URL("URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println("term=" + stringToLookup);
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
ant help greatly appreciated ...
david
i have a program working on windows but when i copy it over to unix and compile it there and run it it gives me this error:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:282)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:124)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:111)
at java.net.Socket.<init>(Socket.java:221)
at java.net.Socket.<init>(Socket.java:89)
at sun.net.NetworkClient.doConnect(NetworkClient.java:54)
at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at lookup.main(lookup.java:30)
the unix machine is connected to the net !
its just a simple program that creates a URL object.
gets a URLConnection from this. gets an inputstream
from and an output stream. and runs
the cgi program on dictionary.com for looking up words.
anyone any idea where the error is coming from ?
in case im being vague ... heres a smidgeon of my
code.
URL url = new URL("URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println("term=" + stringToLookup);
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
ant help greatly appreciated ...
david