I have a java application which reads a file from a website address:
URL vers = new URL("mysiteurl"+"/file.txt");
URLConnection conn = vers.openConnection();
conn.setDoInput(true);
conn.setUseCaches(false);
DataInputStream in = new DataInputStream(conn.getInputStream() );
String value= in.readUTF();
This works fine on windows XP, and fine on Windows Vista if the
application is installed (using Install4j) from a Vista administrator
account.
But if installed from Vista standard account i always get an exception from
the above:
java.net.ConnectException: Connection refused: connect.
Ive tried this with the different Vista execution levels and get the same
exception.
Reading a html file I get the Exception: Connection refused: connect.
Is there some reason why a java application cant read a file from the
internet on a Vista standard account?
patrick - 09 Jan 2008 13:21 GMT
Have found that if I turn off Norton personal firewall the error goes away.
But cant switch on the firewall and configure it to allow my program to
read the file without the Exception.
patrick - 09 Jan 2008 15:43 GMT
Problem solved. Firewall problem. add the website ip address to Norton
trusted sites.
Roedy Green - 15 Jan 2008 12:50 GMT
>Is there some reason why a java application cant read a file from the
>internet on a Vista standard account?
use a protocol sniffer. Sounds like the server may be rejecting you
for some reason. Compare the headers that get sent under XP vs Vista.
You can also experiment with my code at
http://mindprod.com/products.html#HTTP
to do the same thing.
To talk to a server other that the one from which an applet was loaded
you must be signed.

Signature
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com