cant read web file from Vista

P

patrick

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?
 
P

patrick

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.
 
P

patrick

Problem solved. Firewall problem. add the website ip address to Norton
trusted sites.
 
R

Roedy Green

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top